package com.ruoyi.firefighter.controller;

import com.ruoyi.award.domain.FirefighterAward;
import com.ruoyi.award.service.IFirefighterAwardService;
import  com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.disease.domain.FirefighterDisease;
import com.ruoyi.disease.service.IFirefighterDiseaseService;
import com.ruoyi.drill.domain.FirefighterDrill;
import com.ruoyi.drill.service.IFirefighterDrillService;
import com.ruoyi.emergency.domain.FirefighterEmergency;
import com.ruoyi.emergency.service.IFirefighterEmergencyService;
import com.ruoyi.firefighter.domain.FirefighterInfo;
import com.ruoyi.firefighter.domain.Roleo;
import com.ruoyi.firefighter.service.IFirefighterInfoService;
import com.ruoyi.firefighterFire.domain.FirefighterFire;
import com.ruoyi.firefighterFire.service.IFirefighterFireService;
import com.ruoyi.firefighterTrainingTable.domain.FirefighterTrainingTable;
import com.ruoyi.firefighterTrainingTable.service.IFirefighterTrainingTableService;
import com.ruoyi.graduation.domain.GraduationSchool;
import com.ruoyi.graduation.service.IGraduationSchoolService;
import com.ruoyi.punishment.domain.FirefighterPunishment;
import com.ruoyi.punishment.service.IFirefighterPunishmentService;
import com.ruoyi.qualification.domain.FirefighterQualification;
import com.ruoyi.qualification.service.IFirefighterQualificationService;
import com.ruoyi.record.domain.FirefighterRecord;
import com.ruoyi.record.service.IFirefighterRecordService;
import com.ruoyi.screeningDate.domain.PerformanceA;
import com.ruoyi.security.domain.FirefighterSecurity;
import com.ruoyi.security.service.IFirefighterSecurityService;
import com.ruoyi.ifmEnlistIand.domain.FirefighterFireTable;
import com.ruoyi.ifmEnlistIand.service.IFirefighterFireTableService;
import com.ruoyi.ifmEnlistIand.service.ISysUserService;
import com.ruoyi.subject.domain.FirefighterSubject;
import com.ruoyi.subject.service.IFirefighterSubjectService;
import com.ruoyi.task.domain.FirefighterFireTask;
import com.ruoyi.task.service.IFirefighterFireTaskService;
import com.ruoyi.tournament.domain.FirefighterTournament;
import com.ruoyi.tournament.service.IFirefighterTournamentService;
import com.ruoyi.train.domain.FirefighterTrain;
import com.ruoyi.train.service.IFirefighterTrainService;
import com.ruoyi.vo.ExportFilter;
import com.ruoyi.vo.FirefighterDetailsDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * 消防员信息Controller
 *
 * @author ruoyi
 * @date 2024-09-27
 */
@Slf4j
@RestController
@RequestMapping("/system/firefighterInfo")
public class FireRescueCommonController extends BaseController
{
    @Autowired
    private IFirefighterInfoService firefighterInfoService;

    @Autowired
    private ISysUserService userService;

    @Autowired
    private IFirefighterRecordService firefighterRecordService;

    @Autowired
    private IFirefighterAwardService firefighterAwardService;

    @Autowired
    private IFirefighterDiseaseService firefighterDiseaseService;

    @Autowired
    private IFirefighterDrillService firefighterDrillService;

    @Autowired
    private IFirefighterSecurityService firefighterSecurityService;

    @Autowired
    private IFirefighterTournamentService firefighterTournamentService;

    @Autowired
    private IFirefighterEmergencyService firefighterEmergencyService;

    @Autowired
    private IFirefighterFireTaskService firefighterFireTaskService;

    @Autowired
    private IFirefighterQualificationService firefighterQualificationService;

    @Autowired
    private IFirefighterTrainService firefighterTrainService;

    @Autowired
    private IFirefighterPunishmentService firefighterPunishmentService;

    @Autowired
    private IFirefighterTrainingTableService firefighterTrainingTableService;

    @Autowired
    private IFirefighterFireTableService firefighterFireTableService;
    @Autowired
    private IFirefighterSubjectService  firefighterSubjectService;
    @Autowired
    private IFirefighterFireService firefighterFireService;
    @Autowired
    private IGraduationSchoolService iGraduationSchoolService;
    /**
     * 查询灭火救援岗位技能科目训练登记列表
     */
    @GetMapping("/fireTable/List")
    public TableDataInfo fireTableList(@RequestParam Long userId)
    {
        ArrayList<PerformanceA> performanceAS = new ArrayList<>();
        List<FirefighterFire> firefighterFires = firefighterFireService.selectFirefighterFireList(new FirefighterFire());
        for (FirefighterFire fire : firefighterFires) {
            PerformanceA performanceA = new PerformanceA();
            performanceA.setUserId(userId);
            performanceA.setSubject(fire.getProgramName());
            //三元运算符
            performanceA.setCategory(fire.getRemark().equals("1") ? "单兵项目" : "班级项目");
            performanceAS.add(performanceA);
        }
        FirefighterFireTable firefighterFireTable = new FirefighterFireTable();
        firefighterFireTable.setUserId(userId);
        List<FirefighterFireTable> list = firefighterFireTableService.selectFirefighterFireTableList(firefighterFireTable);
        for (FirefighterFireTable fireTable : list) {
            fireTable.setEntryDate(fireTable.getEntryDate().split("-")[1]);
        }
        //去重根据月份保存新集合
        Map<String, FirefighterFireTable> uniqueByEntryDate = list.stream()
                .collect(Collectors.toMap(
                        FirefighterFireTable::getEntryDate, // 键映射器：将每个对象映射到其getEntryDate()返回的日期
                        Function.identity(), // 值映射器：直接使用对象作为值
                        (existing, replacement) -> existing // 合并函数：如果键已经存在，保留现有的对象（或根据需要选择replacement）
                ));
        // 去重数据
        List<FirefighterFireTable> uniqueTables = new ArrayList<>(uniqueByEntryDate.values());
        for (FirefighterFireTable table : uniqueTables) {
            if (table.getEntryDate().equals("01")){
                for (PerformanceA a : performanceAS) {
                    if (a.getSubject().equals("单一人三盘水带连接")){
                        a.setJanuary(table.getFireProgram());
                    }else if(a.getSubject().equals("沿拉梯铺设水带")){
                        a.setJanuary(table.getFireProgram1());
                    }else if(a.getSubject().equals("垂直铺设水带")){
                        a.setJanuary(table.getFireProgram2());
                    }else if(a.getSubject().equals("狭小空间铺设水带")){
                        a.setJanuary(table.getFireProgram3());
                    }else if(a.getSubject().equals("吸水管连接")){
                        a.setJanuary(table.getFireProgram4());
                    }else if(a.getSubject().equals("射水技术")){
                        a.setJanuary(table.getFireProgram5());
                    }else if(a.getSubject().equals("攀登挂钩梯上四楼")){
                        a.setJanuary(table.getFireProgram6());
                    }else if(a.getSubject().equals("攀登单杠梯")){
                        a.setJanuary(table.getFireProgram7());
                    }else if(a.getSubject().equals("两人五盘水带连接")){
                        a.setJanuary(table.getFireProgram8());
                    }else if(a.getSubject().equals("干线水带更换")){
                        a.setJanuary(table.getFireProgram9());
                    }else if(a.getSubject().equals("楼层吊升水带")){
                        a.setJanuary(table.getFireProgram10());
                    }else if(a.getSubject().equals("水带登高伸长")){
                        a.setJanuary(table.getFireProgram11());
                    }else if(a.getSubject().equals("垂直更换水带")){
                        a.setJanuary(table.getFireProgram12());
                    }else if(a.getSubject().equals("水枪前延长水带")){
                        a.setJanuary(table.getFireProgram13());
                    }else if(a.getSubject().equals("分水器前延长水带")){
                        a.setJanuary(table.getFireProgram14());
                    } else if(a.getSubject().equals("三盘水带连接")){
                        a.setJanuary(table.getFireProgram15());
                    }else if(a.getSubject().equals("纵深灭火操")){
                        a.setJanuary(table.getFireProgram16());
                    }else if(a.getSubject().equals("车辆驾驶")){
                        a.setJanuary(table.getFireProgram17());
                    }else if(a.getSubject().equals("地下有限空间救援操")){
                        a.setJanuary(table.getFireProgram18());
                    }else if(a.getSubject().equals("百米障碍救助操")){
                        a.setJanuary(table.getFireProgram19());
                    }else if(a.getSubject().equals("信息综合查询操")){
                        a.setJanuary(table.getFireProgram20());
                    }else if(a.getSubject().equals("拉梯与钩梯联用操")){
                        a.setJanuary(table.getFireProgram21());
                    }else if(a.getSubject().equals("车辆操作")){
                        a.setJanuary(table.getFireProgram22());
                    }else if(a.getSubject().equals("十五米拉梯架设操")){
                        a.setJanuary(table.getFireProgram23());
                    }else if(a.getSubject().equals("枪炮协同操")){
                        a.setJanuary(table.getFireProgram24());
                    }else if(a.getSubject().equals("片图绘制")){
                        a.setJanuary(table.getFireProgram25());
                    }else if(a.getSubject().equals("60米肩梯架设操")){
                        a.setJanuary(table.getFireProgram26());
                    }else if(a.getSubject().equals("绳结制作操")){
                        a.setJanuary(table.getFireProgram27());
                    }else if(a.getSubject().equals("三盘水带连接操")){
                        a.setJanuary(table.getFireProgram28());
                    }else if(a.getSubject().equals("楼层火灾内攻操")){
                        a.setJanuary(table.getFireProgram29());
                    }else if(a.getSubject().equals("挂钩提上四楼")){
                        a.setJanuary(table.getFireProgram30());
                    }else if(a.getSubject().equals("车辆引导")){
                        a.setJanuary(table.getFireProgram31());
                    }else if(a.getSubject().equals("无人机侦察操")){
                        a.setJanuary(table.getFireProgram32());
                    } else if(a.getSubject().equals("地下有限空间救人操")){
                        a.setJanuary(table.getFireProgram33());
                    }else if(a.getSubject().equals("车载炮出水")){
                        a.setJanuary(table.getFireProgram34());
                    }else if(a.getSubject().equals("四节吸水管连接操")){
                        a.setJanuary(table.getFireProgram35());
                    }else if(a.getSubject().equals("顶撑救援操")){
                        a.setJanuary(table.getFireProgram36());
                    }else if(a.getSubject().equals("冰面救援技术")){
                        a.setJanuary(table.getFireProgram37());
                    }else if(a.getSubject().equals("快速出水操")){
                        a.setJanuary(table.getFireProgram38());
                    }else if(a.getSubject().equals("三人着装打靶操")){
                        a.setJanuary(table.getFireProgram39());
                    }else if(a.getSubject().equals("纵深灭火救人操")){
                        a.setJanuary(table.getFireProgram40());
                    } else if(a.getSubject().equals("防盗门（窗）破拆操")){
                        a.setJanuary(table.getFireProgram41());
                    }else if(a.getSubject().equals("3车6组建筑火灾初战扑救操")){
                        a.setJanuary(table.getFireProgram42());
                    }else if(a.getSubject().equals("8种常用绳结及7倍力以下倍力系统制作")){
                        a.setJanuary(table.getFireProgram43());
                    }
                }
            }else if(table.getEntryDate().equals("02")){
                for (PerformanceA a : performanceAS) {
                    if (a.getSubject().equals("单一人三盘水带连接")){
                        a.setFebruary(table.getFireProgram());
                    }else if(a.getSubject().equals("沿拉梯铺设水带")){
                        a.setFebruary(table.getFireProgram1());
                    }else if(a.getSubject().equals("垂直铺设水带")){
                        a.setFebruary(table.getFireProgram2());
                    }else if(a.getSubject().equals("狭小空间铺设水带")){
                        a.setFebruary(table.getFireProgram3());
                    }else if(a.getSubject().equals("吸水管连接")){
                        a.setFebruary(table.getFireProgram4());
                    }else if(a.getSubject().equals("射水技术")){
                        a.setFebruary(table.getFireProgram5());
                    }else if(a.getSubject().equals("攀登挂钩梯上四楼")){
                        a.setFebruary(table.getFireProgram6());
                    }else if(a.getSubject().equals("攀登单杠梯")){
                        a.setFebruary(table.getFireProgram7());
                    }else if(a.getSubject().equals("两人五盘水带连接")){
                        a.setFebruary(table.getFireProgram8());
                    }else if(a.getSubject().equals("干线水带更换")){
                        a.setFebruary(table.getFireProgram9());
                    }else if(a.getSubject().equals("楼层吊升水带")){
                        a.setFebruary(table.getFireProgram10());
                    }else if(a.getSubject().equals("水带登高伸长")){
                        a.setFebruary(table.getFireProgram11());
                    }else if(a.getSubject().equals("垂直更换水带")){
                        a.setFebruary(table.getFireProgram12());
                    }else if(a.getSubject().equals("水枪前延长水带")){
                        a.setFebruary(table.getFireProgram13());
                    }else if(a.getSubject().equals("分水器前延长水带")){
                        a.setFebruary(table.getFireProgram14());
                    }else if(a.getSubject().equals("三盘水带连接")){
                        a.setFebruary(table.getFireProgram15());
                    }else if(a.getSubject().equals("纵深灭火操")){
                        a.setFebruary(table.getFireProgram16());
                    }else if(a.getSubject().equals("车辆驾驶")){
                        a.setFebruary(table.getFireProgram17());
                    }else if(a.getSubject().equals("地下有限空间救援操")){
                        a.setFebruary(table.getFireProgram18());
                    }else if(a.getSubject().equals("百米障碍救助操")){
                        a.setFebruary(table.getFireProgram19());
                    }else if(a.getSubject().equals("信息综合查询操")){
                        a.setFebruary(table.getFireProgram20());
                    }else if(a.getSubject().equals("拉梯与钩梯联用操")){
                        a.setFebruary(table.getFireProgram21());
                    }else if(a.getSubject().equals("车辆操作")){
                        a.setFebruary(table.getFireProgram22());
                    }else if(a.getSubject().equals("十五米拉梯架设操")){
                        a.setFebruary(table.getFireProgram23());
                    }else if(a.getSubject().equals("枪炮协同操")){
                        a.setFebruary(table.getFireProgram24());
                    }else if(a.getSubject().equals("片图绘制")){
                        a.setFebruary(table.getFireProgram25());
                    }else if(a.getSubject().equals("60米肩梯架设操")){
                        a.setFebruary(table.getFireProgram26());
                    }else if(a.getSubject().equals("绳结制作操")){
                        a.setFebruary(table.getFireProgram27());
                    }else if(a.getSubject().equals("三盘水带连接操")){
                        a.setFebruary(table.getFireProgram28());
                    }else if(a.getSubject().equals("楼层火灾内攻操")){
                        a.setFebruary(table.getFireProgram29());
                    }else if(a.getSubject().equals("挂钩提上四楼")){
                        a.setFebruary(table.getFireProgram30());
                    }else if(a.getSubject().equals("车辆引导")){
                        a.setFebruary(table.getFireProgram31());
                    }else if(a.getSubject().equals("无人机侦察操")){
                        a.setFebruary(table.getFireProgram32());
                    } else if(a.getSubject().equals("地下有限空间救人操")){
                        a.setFebruary(table.getFireProgram33());
                    }else if(a.getSubject().equals("车载炮出水")){
                        a.setFebruary(table.getFireProgram34());
                    }else if(a.getSubject().equals("四节吸水管连接操")){
                        a.setFebruary(table.getFireProgram35());
                    }else if(a.getSubject().equals("顶撑救援操")){
                        a.setFebruary(table.getFireProgram36());
                    }else if(a.getSubject().equals("冰面救援技术")){
                        a.setFebruary(table.getFireProgram37());
                    }else if(a.getSubject().equals("快速出水操")){
                        a.setFebruary(table.getFireProgram38());
                    }else if(a.getSubject().equals("三人着装打靶操")){
                        a.setFebruary(table.getFireProgram39());
                    }else if(a.getSubject().equals("纵深灭火救人操")){
                        a.setFebruary(table.getFireProgram40());
                    } else if(a.getSubject().equals("防盗门（窗）破拆操")){
                        a.setFebruary(table.getFireProgram41());
                    }else if(a.getSubject().equals("3车6组建筑火灾初战扑救操")){
                        a.setFebruary(table.getFireProgram42());
                    }else if(a.getSubject().equals("8种常用绳结及7倍力以下倍力系统制作")){
                        a.setFebruary(table.getFireProgram43());
                    }
                }
            }else if(table.getEntryDate().equals("03")){
                for (PerformanceA a : performanceAS) {
                    if (a.getSubject().equals("单一人三盘水带连接")){
                        a.setMarch(table.getFireProgram());
                    }else if(a.getSubject().equals("沿拉梯铺设水带")){
                        a.setMarch(table.getFireProgram1());
                    }else if(a.getSubject().equals("垂直铺设水带")){
                        a.setMarch(table.getFireProgram2());
                    }else if(a.getSubject().equals("狭小空间铺设水带")){
                        a.setMarch(table.getFireProgram3());
                    }else if(a.getSubject().equals("吸水管连接")){
                        a.setMarch(table.getFireProgram4());
                    }else if(a.getSubject().equals("射水技术")){
                        a.setMarch(table.getFireProgram5());
                    }else if(a.getSubject().equals("攀登挂钩梯上四楼")){
                        a.setMarch(table.getFireProgram6());
                    }else if(a.getSubject().equals("攀登单杠梯")){
                        a.setMarch(table.getFireProgram7());
                    }else if(a.getSubject().equals("两人五盘水带连接")){
                        a.setMarch(table.getFireProgram8());
                    }else if(a.getSubject().equals("干线水带更换")){
                        a.setMarch(table.getFireProgram9());
                    }else if(a.getSubject().equals("楼层吊升水带")){
                        a.setMarch(table.getFireProgram10());
                    }else if(a.getSubject().equals("水带登高伸长")){
                        a.setMarch(table.getFireProgram11());
                    }else if(a.getSubject().equals("垂直更换水带")){
                        a.setMarch(table.getFireProgram12());
                    }else if(a.getSubject().equals("水枪前延长水带")){
                        a.setMarch(table.getFireProgram13());
                    }else if(a.getSubject().equals("分水器前延长水带")){
                        a.setMarch(table.getFireProgram14());
                    } else if(a.getSubject().equals("三盘水带连接")){
                        a.setMarch(table.getFireProgram15());
                    }else if(a.getSubject().equals("纵深灭火操")){
                        a.setMarch(table.getFireProgram16());
                    }else if(a.getSubject().equals("车辆驾驶")){
                        a.setMarch(table.getFireProgram17());
                    }else if(a.getSubject().equals("地下有限空间救援操")){
                        a.setMarch(table.getFireProgram18());
                    }else if(a.getSubject().equals("百米障碍救助操")){
                        a.setMarch(table.getFireProgram19());
                    }else if(a.getSubject().equals("信息综合查询操")){
                        a.setMarch(table.getFireProgram20());
                    }else if(a.getSubject().equals("拉梯与钩梯联用操")){
                        a.setMarch(table.getFireProgram21());
                    }else if(a.getSubject().equals("车辆操作")){
                        a.setMarch(table.getFireProgram22());
                    }else if(a.getSubject().equals("十五米拉梯架设操")){
                        a.setMarch(table.getFireProgram23());
                    }else if(a.getSubject().equals("枪炮协同操")){
                        a.setMarch(table.getFireProgram24());
                    }else if(a.getSubject().equals("片图绘制")){
                        a.setMarch(table.getFireProgram25());
                    }else if(a.getSubject().equals("60米肩梯架设操")){
                        a.setMarch(table.getFireProgram26());
                    }else if(a.getSubject().equals("绳结制作操")){
                        a.setMarch(table.getFireProgram27());
                    }else if(a.getSubject().equals("三盘水带连接操")){
                        a.setMarch(table.getFireProgram28());
                    }else if(a.getSubject().equals("楼层火灾内攻操")){
                        a.setMarch(table.getFireProgram29());
                    }else if(a.getSubject().equals("挂钩提上四楼")){
                        a.setMarch(table.getFireProgram30());
                    }else if(a.getSubject().equals("车辆引导")){
                        a.setMarch(table.getFireProgram31());
                    }else if(a.getSubject().equals("无人机侦察操")){
                        a.setMarch(table.getFireProgram32());
                    } else if(a.getSubject().equals("地下有限空间救人操")){
                        a.setMarch(table.getFireProgram33());
                    }else if(a.getSubject().equals("车载炮出水")){
                        a.setMarch(table.getFireProgram34());
                    }else if(a.getSubject().equals("四节吸水管连接操")){
                        a.setMarch(table.getFireProgram35());
                    }else if(a.getSubject().equals("顶撑救援操")){
                        a.setMarch(table.getFireProgram36());
                    }else if(a.getSubject().equals("冰面救援技术")){
                        a.setMarch(table.getFireProgram37());
                    }else if(a.getSubject().equals("快速出水操")){
                        a.setMarch(table.getFireProgram38());
                    }else if(a.getSubject().equals("三人着装打靶操")){
                        a.setMarch(table.getFireProgram39());
                    }else if(a.getSubject().equals("纵深灭火救人操")){
                        a.setMarch(table.getFireProgram40());
                    } else if(a.getSubject().equals("防盗门（窗）破拆操")){
                        a.setMarch(table.getFireProgram41());
                    }else if(a.getSubject().equals("3车6组建筑火灾初战扑救操")){
                        a.setMarch(table.getFireProgram42());
                    }else if(a.getSubject().equals("8种常用绳结及7倍力以下倍力系统制作")){
                        a.setMarch(table.getFireProgram43());
                    }
                }
            }else if(table.getEntryDate().equals("04")){
                for (PerformanceA a : performanceAS) {
                    if (a.getSubject().equals("单一人三盘水带连接")){
                        a.setApril(table.getFireProgram());
                    }else if(a.getSubject().equals("沿拉梯铺设水带")){
                        a.setApril(table.getFireProgram1());
                    }else if(a.getSubject().equals("垂直铺设水带")){
                        a.setApril(table.getFireProgram2());
                    }else if(a.getSubject().equals("狭小空间铺设水带")){
                        a.setApril(table.getFireProgram3());
                    }else if(a.getSubject().equals("吸水管连接")){
                        a.setApril(table.getFireProgram4());
                    }else if(a.getSubject().equals("射水技术")){
                        a.setApril(table.getFireProgram5());
                    }else if(a.getSubject().equals("攀登挂钩梯上四楼")){
                        a.setApril(table.getFireProgram6());
                    }else if(a.getSubject().equals("攀登单杠梯")){
                        a.setApril(table.getFireProgram7());
                    }else if(a.getSubject().equals("两人五盘水带连接")){
                        a.setApril(table.getFireProgram8());
                    }else if(a.getSubject().equals("干线水带更换")){
                        a.setApril(table.getFireProgram9());
                    }else if(a.getSubject().equals("楼层吊升水带")){
                        a.setApril(table.getFireProgram10());
                    }else if(a.getSubject().equals("水带登高伸长")){
                        a.setApril(table.getFireProgram11());
                    }else if(a.getSubject().equals("垂直更换水带")){
                        a.setApril(table.getFireProgram12());
                    }else if(a.getSubject().equals("水枪前延长水带")){
                        a.setApril(table.getFireProgram13());
                    }else if(a.getSubject().equals("分水器前延长水带")){
                        a.setApril(table.getFireProgram14());
                    } else if(a.getSubject().equals("三盘水带连接")){
                        a.setApril(table.getFireProgram15());
                    }else if(a.getSubject().equals("纵深灭火操")){
                        a.setApril(table.getFireProgram16());
                    }else if(a.getSubject().equals("车辆驾驶")){
                        a.setApril(table.getFireProgram17());
                    }else if(a.getSubject().equals("地下有限空间救援操")){
                        a.setApril(table.getFireProgram18());
                    }else if(a.getSubject().equals("百米障碍救助操")){
                        a.setApril(table.getFireProgram19());
                    }else if(a.getSubject().equals("信息综合查询操")){
                        a.setApril(table.getFireProgram20());
                    }else if(a.getSubject().equals("拉梯与钩梯联用操")){
                        a.setApril(table.getFireProgram21());
                    }else if(a.getSubject().equals("车辆操作")){
                        a.setApril(table.getFireProgram22());
                    }else if(a.getSubject().equals("十五米拉梯架设操")){
                        a.setApril(table.getFireProgram23());
                    }else if(a.getSubject().equals("枪炮协同操")){
                        a.setApril(table.getFireProgram24());
                    }else if(a.getSubject().equals("片图绘制")){
                        a.setApril(table.getFireProgram25());
                    }else if(a.getSubject().equals("60米肩梯架设操")){
                        a.setApril(table.getFireProgram26());
                    }else if(a.getSubject().equals("绳结制作操")){
                        a.setApril(table.getFireProgram27());
                    }else if(a.getSubject().equals("三盘水带连接操")){
                        a.setApril(table.getFireProgram28());
                    }else if(a.getSubject().equals("楼层火灾内攻操")){
                        a.setApril(table.getFireProgram29());
                    }else if(a.getSubject().equals("挂钩提上四楼")){
                        a.setApril(table.getFireProgram30());
                    }else if(a.getSubject().equals("车辆引导")){
                        a.setApril(table.getFireProgram31());
                    }else if(a.getSubject().equals("无人机侦察操")){
                        a.setApril(table.getFireProgram32());
                    } else if(a.getSubject().equals("地下有限空间救人操")){
                        a.setApril(table.getFireProgram33());
                    }else if(a.getSubject().equals("车载炮出水")){
                        a.setApril(table.getFireProgram34());
                    }else if(a.getSubject().equals("四节吸水管连接操")){
                        a.setApril(table.getFireProgram35());
                    }else if(a.getSubject().equals("顶撑救援操")){
                        a.setApril(table.getFireProgram36());
                    }else if(a.getSubject().equals("冰面救援技术")){
                        a.setApril(table.getFireProgram37());
                    }else if(a.getSubject().equals("快速出水操")){
                        a.setApril(table.getFireProgram38());
                    }else if(a.getSubject().equals("三人着装打靶操")){
                        a.setApril(table.getFireProgram39());
                    }else if(a.getSubject().equals("纵深灭火救人操")){
                        a.setApril(table.getFireProgram40());
                    } else if(a.getSubject().equals("防盗门（窗）破拆操")){
                        a.setApril(table.getFireProgram41());
                    }else if(a.getSubject().equals("3车6组建筑火灾初战扑救操")){
                        a.setApril(table.getFireProgram42());
                    }else if(a.getSubject().equals("8种常用绳结及7倍力以下倍力系统制作")){
                        a.setApril(table.getFireProgram43());
                    }
                }
            }else if(table.getEntryDate().equals("05")){
                for (PerformanceA a : performanceAS) {
                    if (a.getSubject().equals("单一人三盘水带连接")){
                        a.setMay(table.getFireProgram());
                    }else if(a.getSubject().equals("沿拉梯铺设水带")){
                        a.setMay(table.getFireProgram1());
                    }else if(a.getSubject().equals("垂直铺设水带")){
                        a.setMay(table.getFireProgram2());
                    }else if(a.getSubject().equals("狭小空间铺设水带")){
                        a.setMay(table.getFireProgram3());
                    }else if(a.getSubject().equals("吸水管连接")){
                        a.setMay(table.getFireProgram4());
                    }else if(a.getSubject().equals("射水技术")){
                        a.setMay(table.getFireProgram5());
                    }else if(a.getSubject().equals("攀登挂钩梯上四楼")){
                        a.setMay(table.getFireProgram6());
                    }else if(a.getSubject().equals("攀登单杠梯")){
                        a.setMay(table.getFireProgram7());
                    }else if(a.getSubject().equals("两人五盘水带连接")){
                        a.setMay(table.getFireProgram8());
                    }else if(a.getSubject().equals("干线水带更换")){
                        a.setMay(table.getFireProgram9());
                    }else if(a.getSubject().equals("楼层吊升水带")){
                        a.setMay(table.getFireProgram10());
                    }else if(a.getSubject().equals("水带登高伸长")){
                        a.setMay(table.getFireProgram11());
                    }else if(a.getSubject().equals("垂直更换水带")){
                        a.setMay(table.getFireProgram12());
                    }else if(a.getSubject().equals("水枪前延长水带")){
                        a.setMay(table.getFireProgram13());
                    }else if(a.getSubject().equals("分水器前延长水带")){
                        a.setMay(table.getFireProgram14());
                    } else if(a.getSubject().equals("三盘水带连接")){
                        a.setMay(table.getFireProgram15());
                    }else if(a.getSubject().equals("纵深灭火操")){
                        a.setMay(table.getFireProgram16());
                    }else if(a.getSubject().equals("车辆驾驶")){
                        a.setMay(table.getFireProgram17());
                    }else if(a.getSubject().equals("地下有限空间救援操")){
                        a.setMay(table.getFireProgram18());
                    }else if(a.getSubject().equals("百米障碍救助操")){
                        a.setMay(table.getFireProgram19());
                    }else if(a.getSubject().equals("信息综合查询操")){
                        a.setMay(table.getFireProgram20());
                    }else if(a.getSubject().equals("拉梯与钩梯联用操")){
                        a.setMay(table.getFireProgram21());
                    }else if(a.getSubject().equals("车辆操作")){
                        a.setMay(table.getFireProgram22());
                    }else if(a.getSubject().equals("十五米拉梯架设操")){
                        a.setMay(table.getFireProgram23());
                    }else if(a.getSubject().equals("枪炮协同操")){
                        a.setMay(table.getFireProgram24());
                    }else if(a.getSubject().equals("片图绘制")){
                        a.setMay(table.getFireProgram25());
                    }else if(a.getSubject().equals("60米肩梯架设操")){
                        a.setMay(table.getFireProgram26());
                    }else if(a.getSubject().equals("绳结制作操")){
                        a.setMay(table.getFireProgram27());
                    }else if(a.getSubject().equals("三盘水带连接操")){
                        a.setMay(table.getFireProgram28());
                    }else if(a.getSubject().equals("楼层火灾内攻操")){
                        a.setMay(table.getFireProgram29());
                    }else if(a.getSubject().equals("挂钩提上四楼")){
                        a.setMay(table.getFireProgram30());
                    }else if(a.getSubject().equals("车辆引导")){
                        a.setMay(table.getFireProgram31());
                    }else if(a.getSubject().equals("无人机侦察操")){
                        a.setMay(table.getFireProgram32());
                    } else if(a.getSubject().equals("地下有限空间救人操")){
                        a.setMay(table.getFireProgram33());
                    }else if(a.getSubject().equals("车载炮出水")){
                        a.setMay(table.getFireProgram34());
                    }else if(a.getSubject().equals("四节吸水管连接操")){
                        a.setMay(table.getFireProgram35());
                    }else if(a.getSubject().equals("顶撑救援操")){
                        a.setMay(table.getFireProgram36());
                    }else if(a.getSubject().equals("冰面救援技术")){
                        a.setMay(table.getFireProgram37());
                    }else if(a.getSubject().equals("快速出水操")){
                        a.setMay(table.getFireProgram38());
                    }else if(a.getSubject().equals("三人着装打靶操")){
                        a.setMay(table.getFireProgram39());
                    }else if(a.getSubject().equals("纵深灭火救人操")){
                        a.setMay(table.getFireProgram40());
                    } else if(a.getSubject().equals("防盗门（窗）破拆操")){
                        a.setMay(table.getFireProgram41());
                    }else if(a.getSubject().equals("3车6组建筑火灾初战扑救操")){
                        a.setMay(table.getFireProgram42());
                    }else if(a.getSubject().equals("8种常用绳结及7倍力以下倍力系统制作")){
                        a.setMay(table.getFireProgram43());
                    }
                }
            }else if(table.getEntryDate().equals("06")){
                for (PerformanceA a : performanceAS) {
                    if (a.getSubject().equals("单一人三盘水带连接")){
                        a.setJune(table.getFireProgram());
                    }else if(a.getSubject().equals("沿拉梯铺设水带")){
                        a.setJune(table.getFireProgram1());
                    }else if(a.getSubject().equals("垂直铺设水带")){
                        a.setJune(table.getFireProgram2());
                    }else if(a.getSubject().equals("狭小空间铺设水带")){
                        a.setJune(table.getFireProgram3());
                    }else if(a.getSubject().equals("吸水管连接")){
                        a.setJune(table.getFireProgram4());
                    }else if(a.getSubject().equals("射水技术")){
                        a.setJune(table.getFireProgram5());
                    }else if(a.getSubject().equals("攀登挂钩梯上四楼")){
                        a.setJune(table.getFireProgram6());
                    }else if(a.getSubject().equals("攀登单杠梯")){
                        a.setJune(table.getFireProgram7());
                    }else if(a.getSubject().equals("两人五盘水带连接")){
                        a.setJune(table.getFireProgram8());
                    }else if(a.getSubject().equals("干线水带更换")){
                        a.setJune(table.getFireProgram9());
                    }else if(a.getSubject().equals("楼层吊升水带")){
                        a.setJune(table.getFireProgram10());
                    }else if(a.getSubject().equals("水带登高伸长")){
                        a.setJune(table.getFireProgram11());
                    }else if(a.getSubject().equals("垂直更换水带")){
                        a.setJune(table.getFireProgram12());
                    }else if(a.getSubject().equals("水枪前延长水带")){
                        a.setJune(table.getFireProgram13());
                    }else if(a.getSubject().equals("分水器前延长水带")){
                        a.setJune(table.getFireProgram14());
                    } else if(a.getSubject().equals("三盘水带连接")){
                        a.setJune(table.getFireProgram15());
                    }else if(a.getSubject().equals("纵深灭火操")){
                        a.setJune(table.getFireProgram16());
                    }else if(a.getSubject().equals("车辆驾驶")){
                        a.setJune(table.getFireProgram17());
                    }else if(a.getSubject().equals("地下有限空间救援操")){
                        a.setJune(table.getFireProgram18());
                    }else if(a.getSubject().equals("百米障碍救助操")){
                        a.setJune(table.getFireProgram19());
                    }else if(a.getSubject().equals("信息综合查询操")){
                        a.setJune(table.getFireProgram20());
                    }else if(a.getSubject().equals("拉梯与钩梯联用操")){
                        a.setJune(table.getFireProgram21());
                    }else if(a.getSubject().equals("车辆操作")){
                        a.setJune(table.getFireProgram22());
                    }else if(a.getSubject().equals("十五米拉梯架设操")){
                        a.setJune(table.getFireProgram23());
                    }else if(a.getSubject().equals("枪炮协同操")){
                        a.setJune(table.getFireProgram24());
                    }else if(a.getSubject().equals("片图绘制")){
                        a.setJune(table.getFireProgram25());
                    }else if(a.getSubject().equals("60米肩梯架设操")){
                        a.setJune(table.getFireProgram26());
                    }else if(a.getSubject().equals("绳结制作操")){
                        a.setJune(table.getFireProgram27());
                    }else if(a.getSubject().equals("三盘水带连接操")){
                        a.setJune(table.getFireProgram28());
                    }else if(a.getSubject().equals("楼层火灾内攻操")){
                        a.setJune(table.getFireProgram29());
                    }else if(a.getSubject().equals("挂钩提上四楼")){
                        a.setJune(table.getFireProgram30());
                    }else if(a.getSubject().equals("车辆引导")){
                        a.setJune(table.getFireProgram31());
                    }else if(a.getSubject().equals("无人机侦察操")){
                        a.setJune(table.getFireProgram32());
                    } else if(a.getSubject().equals("地下有限空间救人操")){
                        a.setJune(table.getFireProgram33());
                    }else if(a.getSubject().equals("车载炮出水")){
                        a.setJune(table.getFireProgram34());
                    }else if(a.getSubject().equals("四节吸水管连接操")){
                        a.setJune(table.getFireProgram35());
                    }else if(a.getSubject().equals("顶撑救援操")){
                        a.setJune(table.getFireProgram36());
                    }else if(a.getSubject().equals("冰面救援技术")){
                        a.setJune(table.getFireProgram37());
                    }else if(a.getSubject().equals("快速出水操")){
                        a.setJune(table.getFireProgram38());
                    }else if(a.getSubject().equals("三人着装打靶操")){
                        a.setJune(table.getFireProgram39());
                    }else if(a.getSubject().equals("纵深灭火救人操")){
                        a.setJune(table.getFireProgram40());
                    } else if(a.getSubject().equals("防盗门（窗）破拆操")){
                        a.setJune(table.getFireProgram41());
                    }else if(a.getSubject().equals("3车6组建筑火灾初战扑救操")){
                        a.setJune(table.getFireProgram42());
                    }else if(a.getSubject().equals("8种常用绳结及7倍力以下倍力系统制作")){
                        a.setJune(table.getFireProgram43());
                    }
                }
            }else if(table.getEntryDate().equals("07")){
                for (PerformanceA a : performanceAS) {
                    if (a.getSubject().equals("单一人三盘水带连接")){
                        a.setJuly(table.getFireProgram());
                    }else if(a.getSubject().equals("沿拉梯铺设水带")){
                        a.setJuly(table.getFireProgram1());
                    }else if(a.getSubject().equals("垂直铺设水带")){
                        a.setJuly(table.getFireProgram2());
                    }else if(a.getSubject().equals("狭小空间铺设水带")){
                        a.setJuly(table.getFireProgram3());
                    }else if(a.getSubject().equals("吸水管连接")){
                        a.setJuly(table.getFireProgram4());
                    }else if(a.getSubject().equals("射水技术")){
                        a.setJuly(table.getFireProgram5());
                    }else if(a.getSubject().equals("攀登挂钩梯上四楼")){
                        a.setJuly(table.getFireProgram6());
                    }else if(a.getSubject().equals("攀登单杠梯")){
                        a.setJuly(table.getFireProgram7());
                    }else if(a.getSubject().equals("两人五盘水带连接")){
                        a.setJuly(table.getFireProgram8());
                    }else if(a.getSubject().equals("干线水带更换")){
                        a.setJuly(table.getFireProgram9());
                    }else if(a.getSubject().equals("楼层吊升水带")){
                        a.setJuly(table.getFireProgram10());
                    }else if(a.getSubject().equals("水带登高伸长")){
                        a.setJuly(table.getFireProgram11());
                    }else if(a.getSubject().equals("垂直更换水带")){
                        a.setJuly(table.getFireProgram12());
                    }else if(a.getSubject().equals("水枪前延长水带")){
                        a.setJuly(table.getFireProgram13());
                    }else if(a.getSubject().equals("分水器前延长水带")){
                        a.setJuly(table.getFireProgram14());
                    } else if(a.getSubject().equals("三盘水带连接")){
                        a.setJuly(table.getFireProgram15());
                    }else if(a.getSubject().equals("纵深灭火操")){
                        a.setJuly(table.getFireProgram16());
                    }else if(a.getSubject().equals("车辆驾驶")){
                        a.setJuly(table.getFireProgram17());
                    }else if(a.getSubject().equals("地下有限空间救援操")){
                        a.setJuly(table.getFireProgram18());
                    }else if(a.getSubject().equals("百米障碍救助操")){
                        a.setJuly(table.getFireProgram19());
                    }else if(a.getSubject().equals("信息综合查询操")){
                        a.setJuly(table.getFireProgram20());
                    }else if(a.getSubject().equals("拉梯与钩梯联用操")){
                        a.setJuly(table.getFireProgram21());
                    }else if(a.getSubject().equals("车辆操作")){
                        a.setJuly(table.getFireProgram22());
                    }else if(a.getSubject().equals("十五米拉梯架设操")){
                        a.setJuly(table.getFireProgram23());
                    }else if(a.getSubject().equals("枪炮协同操")){
                        a.setJuly(table.getFireProgram24());
                    }else if(a.getSubject().equals("片图绘制")){
                        a.setJuly(table.getFireProgram25());
                    }else if(a.getSubject().equals("60米肩梯架设操")){
                        a.setJuly(table.getFireProgram26());
                    }else if(a.getSubject().equals("绳结制作操")){
                        a.setJuly(table.getFireProgram27());
                    }else if(a.getSubject().equals("三盘水带连接操")){
                        a.setJuly(table.getFireProgram28());
                    }else if(a.getSubject().equals("楼层火灾内攻操")){
                        a.setJuly(table.getFireProgram29());
                    }else if(a.getSubject().equals("挂钩提上四楼")){
                        a.setJuly(table.getFireProgram30());
                    }else if(a.getSubject().equals("车辆引导")){
                        a.setJuly(table.getFireProgram31());
                    }else if(a.getSubject().equals("无人机侦察操")){
                        a.setJuly(table.getFireProgram32());
                    } else if(a.getSubject().equals("地下有限空间救人操")){
                        a.setJuly(table.getFireProgram33());
                    }else if(a.getSubject().equals("车载炮出水")){
                        a.setJuly(table.getFireProgram34());
                    }else if(a.getSubject().equals("四节吸水管连接操")){
                        a.setJuly(table.getFireProgram35());
                    }else if(a.getSubject().equals("顶撑救援操")){
                        a.setJuly(table.getFireProgram36());
                    }else if(a.getSubject().equals("冰面救援技术")){
                        a.setJuly(table.getFireProgram37());
                    }else if(a.getSubject().equals("快速出水操")){
                        a.setJuly(table.getFireProgram38());
                    }else if(a.getSubject().equals("三人着装打靶操")){
                        a.setJuly(table.getFireProgram39());
                    }else if(a.getSubject().equals("纵深灭火救人操")){
                        a.setJuly(table.getFireProgram40());
                    } else if(a.getSubject().equals("防盗门（窗）破拆操")){
                        a.setJuly(table.getFireProgram41());
                    }else if(a.getSubject().equals("3车6组建筑火灾初战扑救操")){
                        a.setJuly(table.getFireProgram42());
                    }else if(a.getSubject().equals("8种常用绳结及7倍力以下倍力系统制作")){
                        a.setJuly(table.getFireProgram43());
                    }
                }
            }else if(table.getEntryDate().equals("08")){
                for (PerformanceA a : performanceAS) {
                    if (a.getSubject().equals("单一人三盘水带连接")){
                        a.setAugust(table.getFireProgram());
                    }else if(a.getSubject().equals("沿拉梯铺设水带")){
                        a.setAugust(table.getFireProgram1());
                    }else if(a.getSubject().equals("垂直铺设水带")){
                        a.setAugust(table.getFireProgram2());
                    }else if(a.getSubject().equals("狭小空间铺设水带")){
                        a.setAugust(table.getFireProgram3());
                    }else if(a.getSubject().equals("吸水管连接")){
                        a.setAugust(table.getFireProgram4());
                    }else if(a.getSubject().equals("射水技术")){
                        a.setAugust(table.getFireProgram5());
                    }else if(a.getSubject().equals("攀登挂钩梯上四楼")){
                        a.setAugust(table.getFireProgram6());
                    }else if(a.getSubject().equals("攀登单杠梯")){
                        a.setAugust(table.getFireProgram7());
                    }else if(a.getSubject().equals("两人五盘水带连接")){
                        a.setAugust(table.getFireProgram8());
                    }else if(a.getSubject().equals("干线水带更换")){
                        a.setAugust(table.getFireProgram9());
                    }else if(a.getSubject().equals("楼层吊升水带")){
                        a.setAugust(table.getFireProgram10());
                    }else if(a.getSubject().equals("水带登高伸长")){
                        a.setAugust(table.getFireProgram11());
                    }else if(a.getSubject().equals("垂直更换水带")){
                        a.setAugust(table.getFireProgram12());
                    }else if(a.getSubject().equals("水枪前延长水带")){
                        a.setAugust(table.getFireProgram13());
                    }else if(a.getSubject().equals("分水器前延长水带")){
                        a.setAugust(table.getFireProgram14());
                    }else if(a.getSubject().equals("三盘水带连接")){
                        a.setAugust(table.getFireProgram15());
                    }else if(a.getSubject().equals("纵深灭火操")){
                        a.setAugust(table.getFireProgram16());
                    }else if(a.getSubject().equals("车辆驾驶")){
                        a.setAugust(table.getFireProgram17());
                    }else if(a.getSubject().equals("地下有限空间救援操")){
                        a.setAugust(table.getFireProgram18());
                    }else if(a.getSubject().equals("百米障碍救助操")){
                        a.setAugust(table.getFireProgram19());
                    }else if(a.getSubject().equals("信息综合查询操")){
                        a.setAugust(table.getFireProgram20());
                    }else if(a.getSubject().equals("拉梯与钩梯联用操")){
                        a.setAugust(table.getFireProgram21());
                    }else if(a.getSubject().equals("车辆操作")){
                        a.setAugust(table.getFireProgram22());
                    }else if(a.getSubject().equals("十五米拉梯架设操")){
                        a.setAugust(table.getFireProgram23());
                    }else if(a.getSubject().equals("枪炮协同操")){
                        a.setAugust(table.getFireProgram24());
                    }else if(a.getSubject().equals("片图绘制")){
                        a.setAugust(table.getFireProgram25());
                    }else if(a.getSubject().equals("60米肩梯架设操")){
                        a.setAugust(table.getFireProgram26());
                    }else if(a.getSubject().equals("绳结制作操")){
                        a.setAugust(table.getFireProgram27());
                    }else if(a.getSubject().equals("三盘水带连接操")){
                        a.setAugust(table.getFireProgram28());
                    }else if(a.getSubject().equals("楼层火灾内攻操")){
                        a.setAugust(table.getFireProgram29());
                    }else if(a.getSubject().equals("挂钩提上四楼")){
                        a.setAugust(table.getFireProgram30());
                    }else if(a.getSubject().equals("车辆引导")){
                        a.setAugust(table.getFireProgram31());
                    }else if(a.getSubject().equals("无人机侦察操")){
                        a.setAugust(table.getFireProgram32());
                    } else if(a.getSubject().equals("地下有限空间救人操")){
                        a.setAugust(table.getFireProgram33());
                    }else if(a.getSubject().equals("车载炮出水")){
                        a.setAugust(table.getFireProgram34());
                    }else if(a.getSubject().equals("四节吸水管连接操")){
                        a.setAugust(table.getFireProgram35());
                    }else if(a.getSubject().equals("顶撑救援操")){
                        a.setAugust(table.getFireProgram36());
                    }else if(a.getSubject().equals("冰面救援技术")){
                        a.setAugust(table.getFireProgram37());
                    }else if(a.getSubject().equals("快速出水操")){
                        a.setAugust(table.getFireProgram38());
                    }else if(a.getSubject().equals("三人着装打靶操")){
                        a.setAugust(table.getFireProgram39());
                    }else if(a.getSubject().equals("纵深灭火救人操")){
                        a.setAugust(table.getFireProgram40());
                    } else if(a.getSubject().equals("防盗门（窗）破拆操")){
                        a.setAugust(table.getFireProgram41());
                    }else if(a.getSubject().equals("3车6组建筑火灾初战扑救操")){
                        a.setAugust(table.getFireProgram42());
                    }else if(a.getSubject().equals("8种常用绳结及7倍力以下倍力系统制作")){
                        a.setAugust(table.getFireProgram43());
                    }
                }
            }else if(table.getEntryDate().equals("09")){
                for (PerformanceA a : performanceAS) {
                    if (a.getSubject().equals("单一人三盘水带连接")){
                        a.setSeptember(table.getFireProgram());
                    }else if(a.getSubject().equals("沿拉梯铺设水带")){
                        a.setSeptember(table.getFireProgram1());
                    }else if(a.getSubject().equals("垂直铺设水带")){
                        a.setSeptember(table.getFireProgram2());
                    }else if(a.getSubject().equals("狭小空间铺设水带")){
                        a.setSeptember(table.getFireProgram3());
                    }else if(a.getSubject().equals("吸水管连接")){
                        a.setSeptember(table.getFireProgram4());
                    }else if(a.getSubject().equals("射水技术")){
                        a.setSeptember(table.getFireProgram5());
                    }else if(a.getSubject().equals("攀登挂钩梯上四楼")){
                        a.setSeptember(table.getFireProgram6());
                    }else if(a.getSubject().equals("攀登单杠梯")){
                        a.setSeptember(table.getFireProgram7());
                    }else if(a.getSubject().equals("两人五盘水带连接")){
                        a.setSeptember(table.getFireProgram8());
                    }else if(a.getSubject().equals("干线水带更换")){
                        a.setSeptember(table.getFireProgram9());
                    }else if(a.getSubject().equals("楼层吊升水带")){
                        a.setSeptember(table.getFireProgram10());
                    }else if(a.getSubject().equals("水带登高伸长")){
                        a.setSeptember(table.getFireProgram11());
                    }else if(a.getSubject().equals("垂直更换水带")){
                        a.setSeptember(table.getFireProgram12());
                    }else if(a.getSubject().equals("水枪前延长水带")){
                        a.setSeptember(table.getFireProgram13());
                    }else if(a.getSubject().equals("分水器前延长水带")){
                        a.setSeptember(table.getFireProgram14());
                    } else if(a.getSubject().equals("三盘水带连接")){
                        a.setSeptember(table.getFireProgram15());
                    }else if(a.getSubject().equals("纵深灭火操")){
                        a.setSeptember(table.getFireProgram16());
                    }else if(a.getSubject().equals("车辆驾驶")){
                        a.setSeptember(table.getFireProgram17());
                    }else if(a.getSubject().equals("地下有限空间救援操")){
                        a.setSeptember(table.getFireProgram18());
                    }else if(a.getSubject().equals("百米障碍救助操")){
                        a.setSeptember(table.getFireProgram19());
                    }else if(a.getSubject().equals("信息综合查询操")){
                        a.setSeptember(table.getFireProgram20());
                    }else if(a.getSubject().equals("拉梯与钩梯联用操")){
                        a.setSeptember(table.getFireProgram21());
                    }else if(a.getSubject().equals("车辆操作")){
                        a.setSeptember(table.getFireProgram22());
                    }else if(a.getSubject().equals("十五米拉梯架设操")){
                        a.setSeptember(table.getFireProgram23());
                    }else if(a.getSubject().equals("枪炮协同操")){
                        a.setSeptember(table.getFireProgram24());
                    }else if(a.getSubject().equals("片图绘制")){
                        a.setSeptember(table.getFireProgram25());
                    }else if(a.getSubject().equals("60米肩梯架设操")){
                        a.setSeptember(table.getFireProgram26());
                    }else if(a.getSubject().equals("绳结制作操")){
                        a.setSeptember(table.getFireProgram27());
                    }else if(a.getSubject().equals("三盘水带连接操")){
                        a.setSeptember(table.getFireProgram28());
                    }else if(a.getSubject().equals("楼层火灾内攻操")){
                        a.setSeptember(table.getFireProgram29());
                    }else if(a.getSubject().equals("挂钩提上四楼")){
                        a.setSeptember(table.getFireProgram30());
                    }else if(a.getSubject().equals("车辆引导")){
                        a.setSeptember(table.getFireProgram31());
                    }else if(a.getSubject().equals("无人机侦察操")){
                        a.setSeptember(table.getFireProgram32());
                    } else if(a.getSubject().equals("地下有限空间救人操")){
                        a.setSeptember(table.getFireProgram33());
                    }else if(a.getSubject().equals("车载炮出水")){
                        a.setSeptember(table.getFireProgram34());
                    }else if(a.getSubject().equals("四节吸水管连接操")){
                        a.setSeptember(table.getFireProgram35());
                    }else if(a.getSubject().equals("顶撑救援操")){
                        a.setSeptember(table.getFireProgram36());
                    }else if(a.getSubject().equals("冰面救援技术")){
                        a.setSeptember(table.getFireProgram37());
                    }else if(a.getSubject().equals("快速出水操")){
                        a.setSeptember(table.getFireProgram38());
                    }else if(a.getSubject().equals("三人着装打靶操")){
                        a.setSeptember(table.getFireProgram39());
                    }else if(a.getSubject().equals("纵深灭火救人操")){
                        a.setSeptember(table.getFireProgram40());
                    } else if(a.getSubject().equals("防盗门（窗）破拆操")){
                        a.setSeptember(table.getFireProgram41());
                    }else if(a.getSubject().equals("3车6组建筑火灾初战扑救操")){
                        a.setSeptember(table.getFireProgram42());
                    }else if(a.getSubject().equals("8种常用绳结及7倍力以下倍力系统制作")){
                        a.setSeptember(table.getFireProgram43());
                    }
                }
            }else if(table.getEntryDate().equals("10")){
                for (PerformanceA a : performanceAS) {
                    if (a.getSubject().equals("单一人三盘水带连接")){
                        a.setOctober(table.getFireProgram());
                    }else if(a.getSubject().equals("沿拉梯铺设水带")){
                        a.setOctober(table.getFireProgram1());
                    }else if(a.getSubject().equals("垂直铺设水带")){
                        a.setOctober(table.getFireProgram2());
                    }else if(a.getSubject().equals("狭小空间铺设水带")){
                        a.setOctober(table.getFireProgram3());
                    }else if(a.getSubject().equals("吸水管连接")){
                        a.setOctober(table.getFireProgram4());
                    }else if(a.getSubject().equals("射水技术")){
                        a.setOctober(table.getFireProgram5());
                    }else if(a.getSubject().equals("攀登挂钩梯上四楼")){
                        a.setOctober(table.getFireProgram6());
                    }else if(a.getSubject().equals("攀登单杠梯")){
                        a.setOctober(table.getFireProgram7());
                    }else if(a.getSubject().equals("两人五盘水带连接")){
                        a.setOctober(table.getFireProgram8());
                    }else if(a.getSubject().equals("干线水带更换")){
                        a.setOctober(table.getFireProgram9());
                    }else if(a.getSubject().equals("楼层吊升水带")){
                        a.setOctober(table.getFireProgram10());
                    }else if(a.getSubject().equals("水带登高伸长")){
                        a.setOctober(table.getFireProgram11());
                    }else if(a.getSubject().equals("垂直更换水带")){
                        a.setOctober(table.getFireProgram12());
                    }else if(a.getSubject().equals("水枪前延长水带")){
                        a.setOctober(table.getFireProgram13());
                    }else if(a.getSubject().equals("分水器前延长水带")){
                        a.setOctober(table.getFireProgram14());
                    } else if(a.getSubject().equals("三盘水带连接")){
                        a.setOctober(table.getFireProgram15());
                    }else if(a.getSubject().equals("纵深灭火操")){
                        a.setOctober(table.getFireProgram16());
                    }else if(a.getSubject().equals("车辆驾驶")){
                        a.setOctober(table.getFireProgram17());
                    }else if(a.getSubject().equals("地下有限空间救援操")){
                        a.setOctober(table.getFireProgram18());
                    }else if(a.getSubject().equals("百米障碍救助操")){
                        a.setOctober(table.getFireProgram19());
                    }else if(a.getSubject().equals("信息综合查询操")){
                        a.setOctober(table.getFireProgram20());
                    }else if(a.getSubject().equals("拉梯与钩梯联用操")){
                        a.setOctober(table.getFireProgram21());
                    }else if(a.getSubject().equals("车辆操作")){
                        a.setOctober(table.getFireProgram22());
                    }else if(a.getSubject().equals("十五米拉梯架设操")){
                        a.setOctober(table.getFireProgram23());
                    }else if(a.getSubject().equals("枪炮协同操")){
                        a.setOctober(table.getFireProgram24());
                    }else if(a.getSubject().equals("片图绘制")){
                        a.setOctober(table.getFireProgram25());
                    }else if(a.getSubject().equals("60米肩梯架设操")){
                        a.setOctober(table.getFireProgram26());
                    }else if(a.getSubject().equals("绳结制作操")){
                        a.setOctober(table.getFireProgram27());
                    }else if(a.getSubject().equals("三盘水带连接操")){
                        a.setOctober(table.getFireProgram28());
                    }else if(a.getSubject().equals("楼层火灾内攻操")){
                        a.setOctober(table.getFireProgram29());
                    }else if(a.getSubject().equals("挂钩提上四楼")){
                        a.setOctober(table.getFireProgram30());
                    }else if(a.getSubject().equals("车辆引导")){
                        a.setOctober(table.getFireProgram31());
                    }else if(a.getSubject().equals("无人机侦察操")){
                        a.setOctober(table.getFireProgram32());
                    } else if(a.getSubject().equals("地下有限空间救人操")){
                        a.setOctober(table.getFireProgram33());
                    }else if(a.getSubject().equals("车载炮出水")){
                        a.setOctober(table.getFireProgram34());
                    }else if(a.getSubject().equals("四节吸水管连接操")){
                        a.setOctober(table.getFireProgram35());
                    }else if(a.getSubject().equals("顶撑救援操")){
                        a.setOctober(table.getFireProgram36());
                    }else if(a.getSubject().equals("冰面救援技术")){
                        a.setOctober(table.getFireProgram37());
                    }else if(a.getSubject().equals("快速出水操")){
                        a.setOctober(table.getFireProgram38());
                    }else if(a.getSubject().equals("三人着装打靶操")){
                        a.setOctober(table.getFireProgram39());
                    }else if(a.getSubject().equals("纵深灭火救人操")){
                        a.setOctober(table.getFireProgram40());
                    } else if(a.getSubject().equals("防盗门（窗）破拆操")){
                        a.setOctober(table.getFireProgram41());
                    }else if(a.getSubject().equals("3车6组建筑火灾初战扑救操")){
                        a.setOctober(table.getFireProgram42());
                    }else if(a.getSubject().equals("8种常用绳结及7倍力以下倍力系统制作")){
                        a.setOctober(table.getFireProgram43());
                    }
                }
            }else if(table.getEntryDate().equals("11")){
                for (PerformanceA a : performanceAS) {
                    if (a.getSubject().equals("单一人三盘水带连接")){
                        a.setNovember(table.getFireProgram());
                    }else if(a.getSubject().equals("沿拉梯铺设水带")){
                        a.setNovember(table.getFireProgram1());
                    }else if(a.getSubject().equals("垂直铺设水带")){
                        a.setNovember(table.getFireProgram2());
                    }else if(a.getSubject().equals("狭小空间铺设水带")){
                        a.setNovember(table.getFireProgram3());
                    }else if(a.getSubject().equals("吸水管连接")){
                        a.setNovember(table.getFireProgram4());
                    }else if(a.getSubject().equals("射水技术")){
                        a.setNovember(table.getFireProgram5());
                    }else if(a.getSubject().equals("攀登挂钩梯上四楼")){
                        a.setNovember(table.getFireProgram6());
                    }else if(a.getSubject().equals("攀登单杠梯")){
                        a.setNovember(table.getFireProgram7());
                    }else if(a.getSubject().equals("两人五盘水带连接")){
                        a.setNovember(table.getFireProgram8());
                    }else if(a.getSubject().equals("干线水带更换")){
                        a.setNovember(table.getFireProgram9());
                    }else if(a.getSubject().equals("楼层吊升水带")){
                        a.setNovember(table.getFireProgram10());
                    }else if(a.getSubject().equals("水带登高伸长")){
                        a.setNovember(table.getFireProgram11());
                    }else if(a.getSubject().equals("垂直更换水带")){
                        a.setNovember(table.getFireProgram12());
                    }else if(a.getSubject().equals("水枪前延长水带")){
                        a.setNovember(table.getFireProgram13());
                    }else if(a.getSubject().equals("分水器前延长水带")){
                        a.setNovember(table.getFireProgram14());
                    } else if(a.getSubject().equals("三盘水带连接")){
                        a.setNovember(table.getFireProgram15());
                    }else if(a.getSubject().equals("纵深灭火操")){
                        a.setNovember(table.getFireProgram16());
                    }else if(a.getSubject().equals("车辆驾驶")){
                        a.setNovember(table.getFireProgram17());
                    }else if(a.getSubject().equals("地下有限空间救援操")){
                        a.setNovember(table.getFireProgram18());
                    }else if(a.getSubject().equals("百米障碍救助操")){
                        a.setNovember(table.getFireProgram19());
                    }else if(a.getSubject().equals("信息综合查询操")){
                        a.setNovember(table.getFireProgram20());
                    }else if(a.getSubject().equals("拉梯与钩梯联用操")){
                        a.setNovember(table.getFireProgram21());
                    }else if(a.getSubject().equals("车辆操作")){
                        a.setNovember(table.getFireProgram22());
                    }else if(a.getSubject().equals("十五米拉梯架设操")){
                        a.setNovember(table.getFireProgram23());
                    }else if(a.getSubject().equals("枪炮协同操")){
                        a.setNovember(table.getFireProgram24());
                    }else if(a.getSubject().equals("片图绘制")){
                        a.setNovember(table.getFireProgram25());
                    }else if(a.getSubject().equals("60米肩梯架设操")){
                        a.setNovember(table.getFireProgram26());
                    }else if(a.getSubject().equals("绳结制作操")){
                        a.setNovember(table.getFireProgram27());
                    }else if(a.getSubject().equals("三盘水带连接操")){
                        a.setNovember(table.getFireProgram28());
                    }else if(a.getSubject().equals("楼层火灾内攻操")){
                        a.setNovember(table.getFireProgram29());
                    }else if(a.getSubject().equals("挂钩提上四楼")){
                        a.setNovember(table.getFireProgram30());
                    }else if(a.getSubject().equals("车辆引导")){
                        a.setNovember(table.getFireProgram31());
                    }else if(a.getSubject().equals("无人机侦察操")){
                        a.setNovember(table.getFireProgram32());
                    } else if(a.getSubject().equals("地下有限空间救人操")){
                        a.setNovember(table.getFireProgram33());
                    }else if(a.getSubject().equals("车载炮出水")){
                        a.setNovember(table.getFireProgram34());
                    }else if(a.getSubject().equals("四节吸水管连接操")){
                        a.setNovember(table.getFireProgram35());
                    }else if(a.getSubject().equals("顶撑救援操")){
                        a.setNovember(table.getFireProgram36());
                    }else if(a.getSubject().equals("冰面救援技术")){
                        a.setNovember(table.getFireProgram37());
                    }else if(a.getSubject().equals("快速出水操")){
                        a.setNovember(table.getFireProgram38());
                    }else if(a.getSubject().equals("三人着装打靶操")){
                        a.setNovember(table.getFireProgram39());
                    }else if(a.getSubject().equals("纵深灭火救人操")){
                        a.setNovember(table.getFireProgram40());
                    } else if(a.getSubject().equals("防盗门（窗）破拆操")){
                        a.setNovember(table.getFireProgram41());
                    }else if(a.getSubject().equals("3车6组建筑火灾初战扑救操")){
                        a.setNovember(table.getFireProgram42());
                    }else if(a.getSubject().equals("8种常用绳结及7倍力以下倍力系统制作")){
                        a.setNovember(table.getFireProgram43());
                    }
                }
            }else if(table.getEntryDate().equals("12")){
                for (PerformanceA a : performanceAS) {
                    if (a.getSubject().equals("单一人三盘水带连接")){
                        a.setDecember(table.getFireProgram());
                    }else if(a.getSubject().equals("沿拉梯铺设水带")){
                        a.setDecember(table.getFireProgram1());
                    }else if(a.getSubject().equals("垂直铺设水带")){
                        a.setDecember(table.getFireProgram2());
                    }else if(a.getSubject().equals("狭小空间铺设水带")){
                        a.setDecember(table.getFireProgram3());
                    }else if(a.getSubject().equals("吸水管连接")){
                        a.setDecember(table.getFireProgram4());
                    }else if(a.getSubject().equals("射水技术")){
                        a.setDecember(table.getFireProgram5());
                    }else if(a.getSubject().equals("攀登挂钩梯上四楼")){
                        a.setDecember(table.getFireProgram6());
                    }else if(a.getSubject().equals("攀登单杠梯")){
                        a.setDecember(table.getFireProgram7());
                    }else if(a.getSubject().equals("两人五盘水带连接")){
                        a.setDecember(table.getFireProgram8());
                    }else if(a.getSubject().equals("干线水带更换")){
                        a.setDecember(table.getFireProgram9());
                    }else if(a.getSubject().equals("楼层吊升水带")){
                        a.setDecember(table.getFireProgram10());
                    }else if(a.getSubject().equals("水带登高伸长")){
                        a.setDecember(table.getFireProgram11());
                    }else if(a.getSubject().equals("垂直更换水带")){
                        a.setDecember(table.getFireProgram12());
                    }else if(a.getSubject().equals("水枪前延长水带")){
                        a.setDecember(table.getFireProgram13());
                    }else if(a.getSubject().equals("分水器前延长水带")){
                        a.setDecember(table.getFireProgram14());
                    } else if(a.getSubject().equals("三盘水带连接")){
                        a.setDecember(table.getFireProgram15());
                    }else if(a.getSubject().equals("纵深灭火操")){
                        a.setDecember(table.getFireProgram16());
                    }else if(a.getSubject().equals("车辆驾驶")){
                        a.setDecember(table.getFireProgram17());
                    }else if(a.getSubject().equals("地下有限空间救援操")){
                        a.setDecember(table.getFireProgram18());
                    }else if(a.getSubject().equals("百米障碍救助操")){
                        a.setDecember(table.getFireProgram19());
                    }else if(a.getSubject().equals("信息综合查询操")){
                        a.setDecember(table.getFireProgram20());
                    }else if(a.getSubject().equals("拉梯与钩梯联用操")){
                        a.setDecember(table.getFireProgram21());
                    }else if(a.getSubject().equals("车辆操作")){
                        a.setDecember(table.getFireProgram22());
                    }else if(a.getSubject().equals("十五米拉梯架设操")){
                        a.setDecember(table.getFireProgram23());
                    }else if(a.getSubject().equals("枪炮协同操")){
                        a.setDecember(table.getFireProgram24());
                    }else if(a.getSubject().equals("片图绘制")){
                        a.setDecember(table.getFireProgram25());
                    }else if(a.getSubject().equals("60米肩梯架设操")){
                        a.setDecember(table.getFireProgram26());
                    }else if(a.getSubject().equals("绳结制作操")){
                        a.setDecember(table.getFireProgram27());
                    }else if(a.getSubject().equals("三盘水带连接操")){
                        a.setDecember(table.getFireProgram28());
                    }else if(a.getSubject().equals("楼层火灾内攻操")){
                        a.setDecember(table.getFireProgram29());
                    }else if(a.getSubject().equals("挂钩提上四楼")){
                        a.setDecember(table.getFireProgram30());
                    }else if(a.getSubject().equals("车辆引导")){
                        a.setDecember(table.getFireProgram31());
                    }else if(a.getSubject().equals("无人机侦察操")){
                        a.setDecember(table.getFireProgram32());
                    } else if(a.getSubject().equals("地下有限空间救人操")){
                        a.setDecember(table.getFireProgram33());
                    }else if(a.getSubject().equals("车载炮出水")){
                        a.setDecember(table.getFireProgram34());
                    }else if(a.getSubject().equals("四节吸水管连接操")){
                        a.setDecember(table.getFireProgram35());
                    }else if(a.getSubject().equals("顶撑救援操")){
                        a.setDecember(table.getFireProgram36());
                    }else if(a.getSubject().equals("冰面救援技术")){
                        a.setDecember(table.getFireProgram37());
                    }else if(a.getSubject().equals("快速出水操")){
                        a.setDecember(table.getFireProgram38());
                    }else if(a.getSubject().equals("三人着装打靶操")){
                        a.setDecember(table.getFireProgram39());
                    }else if(a.getSubject().equals("纵深灭火救人操")){
                        a.setDecember(table.getFireProgram40());
                    } else if(a.getSubject().equals("防盗门（窗）破拆操")){
                        a.setDecember(table.getFireProgram41());
                    }else if(a.getSubject().equals("3车6组建筑火灾初战扑救操")){
                        a.setDecember(table.getFireProgram42());
                    }else if(a.getSubject().equals("8种常用绳结及7倍力以下倍力系统制作")){
                        a.setDecember(table.getFireProgram43());
                    }
                }
            }
        }
        for (PerformanceA a : performanceAS) {
            if (a.getJanuary() == null) {
                a.setJanuary("0");
            }
            if (a.getFebruary() == null) {
                a.setFebruary("0");
            }
            if (a.getMarch() == null) {
                a.setMarch("0");
            }
            if (a.getApril() == null) {
                a.setApril("0");
            }
            if (a.getMay() == null) {
                a.setMay("0");
            }
            if (a.getJune() == null) {
                a.setJune("0");
            }
            if (a.getJuly() == null) {
                a.setJuly("0");
            }
            if (a.getAugust() == null) {
                a.setAugust("0");
            }
            if (a.getSeptember() == null) {
                a.setSeptember("0");
            }
            if (a.getOctober() == null) {
                a.setOctober("0");
            }
            if (a.getNovember() == null) {
                a.setNovember("0");
            }
            if (a.getDecember() == null) {
                a.setDecember("0");
            }
        }
        // 转换列表中的每个元素
        return getDataTable(performanceAS);
    }

    /**
     * 查询体能科目训练登记列表
     */
    @GetMapping("/trainingTable/List")
    public TableDataInfo trainingTablelist(@RequestParam Long userId)
    {
        ArrayList<PerformanceA> performanceAS = new ArrayList<>();
        List<FirefighterSubject> firefighterSubjects = firefighterSubjectService.selectFirefighterSubjectList(new FirefighterSubject());
        for (FirefighterSubject subject : firefighterSubjects) {
            PerformanceA performanceA = new PerformanceA();
            performanceA.setUserId(userId);
            performanceA.setSubject(subject.getProgramName());
            //三元运算符
            performanceA.setCategory(subject.getRemark().equals("1") ? "基础训练" : "应用体能");
            performanceAS.add(performanceA);
        }
        //========================================
        FirefighterTrainingTable firefighterTrainingTable = new FirefighterTrainingTable();
        firefighterTrainingTable.setUserId(userId);
        List<FirefighterTrainingTable> list = firefighterTrainingTableService.selectFirefighterTrainingTableList(firefighterTrainingTable);
        for (FirefighterTrainingTable table : list) {
            table.setEntryDate(table.getEntryDate().split("-")[1]);
        }
        //去重根据月份保存新集合
        Map<String, FirefighterTrainingTable> uniqueByEntryDate = list.stream()
                .collect(Collectors.toMap(
                        FirefighterTrainingTable::getEntryDate, // 键映射器：将每个对象映射到其getEntryDate()返回的日期
                        Function.identity(), // 值映射器：直接使用对象作为值
                        (existing, replacement) -> existing // 合并函数：如果键已经存在，保留现有的对象（或根据需要选择replacement）
                ));
        // 去重数据
        List<FirefighterTrainingTable> uniqueTables = new ArrayList<>(uniqueByEntryDate.values());
        for (FirefighterTrainingTable table : uniqueTables) {
            if (table.getEntryDate().equals("01")){
                for (PerformanceA a : performanceAS) {
                  if (a.getSubject().equals("100米跑")){
                      a.setJanuary(table.getTrainingProgram());
                  }else if(a.getSubject().equals("5000米跑")){
                      a.setJanuary(table.getTrainingProgram1());
                  }else if(a.getSubject().equals("游泳")){
                      a.setJanuary(table.getTrainingProgram2());
                  }else if(a.getSubject().equals("5x25折返跑")){
                      a.setJanuary(table.getTrainingProgram3());
                  }else if(a.getSubject().equals("单杠卷身上")){
                      a.setJanuary(table.getTrainingProgram4());
                  }else if(a.getSubject().equals("双杠臂屈伸")){
                      a.setJanuary(table.getTrainingProgram5());
                  }else if(a.getSubject().equals("百米负重跑")){
                      a.setJanuary(table.getTrainingProgram6());
                  }else if(a.getSubject().equals("负重登10楼")){
                      a.setJanuary(table.getTrainingProgram7());
                  }else if(a.getSubject().equals("400米救人疏散物资")){
                      a.setJanuary(table.getTrainingProgram8());
                  }else if(a.getSubject().equals("爬绳上四楼")){
                      a.setJanuary(table.getTrainingProgram9());
                  }else if(a.getSubject().equals("百米消防障碍")){
                      a.setJanuary(table.getTrainingProgram10());
                  }else if(a.getSubject().equals("60米肩梯")){
                      a.setJanuary(table.getTrainingProgram11());
                  }else if(a.getSubject().equals("搬运重物折返跑")){
                      a.setJanuary(table.getTrainingProgram12());
                  }else if(a.getSubject().equals("负重深蹲")){
                      a.setJanuary(table.getTrainingProgram13());
                  }else if(a.getSubject().equals("爬杆")){
                      a.setJanuary(table.getTrainingProgram14());
                  }
                }
            }else if(table.getEntryDate().equals("02")){
                for (PerformanceA a : performanceAS) {
                    if (a.getSubject().equals("100米跑")){
                        a.setFebruary(table.getTrainingProgram());
                    }else if(a.getSubject().equals("5000米跑")){
                        a.setFebruary(table.getTrainingProgram1());
                    }else if(a.getSubject().equals("游泳")){
                        a.setFebruary(table.getTrainingProgram2());
                    }else if(a.getSubject().equals("5x25折返跑")){
                        a.setFebruary(table.getTrainingProgram3());
                    }else if(a.getSubject().equals("单杠卷身上")){
                        a.setFebruary(table.getTrainingProgram4());
                    }else if(a.getSubject().equals("双杠臂屈伸")){
                        a.setFebruary(table.getTrainingProgram5());
                    }else if(a.getSubject().equals("百米负重跑")){
                        a.setFebruary(table.getTrainingProgram6());
                    }else if(a.getSubject().equals("负重登10楼")){
                        a.setFebruary(table.getTrainingProgram7());
                    }else if(a.getSubject().equals("400米救人疏散物资")){
                        a.setFebruary(table.getTrainingProgram8());
                    }else if(a.getSubject().equals("爬绳上四楼")){
                        a.setFebruary(table.getTrainingProgram9());
                    }else if(a.getSubject().equals("百米消防障碍")){
                        a.setFebruary(table.getTrainingProgram10());
                    }else if(a.getSubject().equals("60米肩梯")){
                        a.setFebruary(table.getTrainingProgram11());
                    }else if(a.getSubject().equals("搬运重物折返跑")){
                        a.setFebruary(table.getTrainingProgram12());
                    }else if(a.getSubject().equals("负重深蹲")){
                        a.setFebruary(table.getTrainingProgram13());
                    }else if(a.getSubject().equals("爬杆")){
                        a.setFebruary(table.getTrainingProgram14());
                    }
                }
            }else if(table.getEntryDate().equals("03")){
                for (PerformanceA a : performanceAS) {
                    if (a.getSubject().equals("100米跑")){
                        a.setMarch(table.getTrainingProgram());
                    }else if(a.getSubject().equals("5000米跑")){
                        a.setMarch(table.getTrainingProgram1());
                    }else if(a.getSubject().equals("游泳")){
                        a.setMarch(table.getTrainingProgram2());
                    }else if(a.getSubject().equals("5x25折返跑")){
                        a.setMarch(table.getTrainingProgram3());
                    }else if(a.getSubject().equals("单杠卷身上")){
                        a.setMarch(table.getTrainingProgram4());
                    }else if(a.getSubject().equals("双杠臂屈伸")){
                        a.setMarch(table.getTrainingProgram5());
                    }else if(a.getSubject().equals("百米负重跑")){
                        a.setMarch(table.getTrainingProgram6());
                    }else if(a.getSubject().equals("负重登10楼")){
                        a.setMarch(table.getTrainingProgram7());
                    }else if(a.getSubject().equals("400米救人疏散物资")){
                        a.setMarch(table.getTrainingProgram8());
                    }else if(a.getSubject().equals("爬绳上四楼")){
                        a.setMarch(table.getTrainingProgram9());
                    }else if(a.getSubject().equals("百米消防障碍")){
                        a.setMarch(table.getTrainingProgram10());
                    }else if(a.getSubject().equals("60米肩梯")){
                        a.setMarch(table.getTrainingProgram11());
                    }else if(a.getSubject().equals("搬运重物折返跑")){
                        a.setMarch(table.getTrainingProgram12());
                    }else if(a.getSubject().equals("负重深蹲")){
                        a.setMarch(table.getTrainingProgram13());
                    }else if(a.getSubject().equals("爬杆")){
                        a.setMarch(table.getTrainingProgram14());
                    }
                }
            }else if(table.getEntryDate().equals("04")){
                for (PerformanceA a : performanceAS) {
                    if (a.getSubject().equals("100米跑")){
                        a.setApril(table.getTrainingProgram());
                    }else if(a.getSubject().equals("5000米跑")){
                        a.setApril(table.getTrainingProgram1());
                    }else if(a.getSubject().equals("游泳")){
                        a.setApril(table.getTrainingProgram2());
                    }else if(a.getSubject().equals("5x25折返跑")){
                        a.setApril(table.getTrainingProgram3());
                    }else if(a.getSubject().equals("单杠卷身上")){
                        a.setApril(table.getTrainingProgram4());
                    }else if(a.getSubject().equals("双杠臂屈伸")){
                        a.setApril(table.getTrainingProgram5());
                    }else if(a.getSubject().equals("百米负重跑")){
                        a.setApril(table.getTrainingProgram6());
                    }else if(a.getSubject().equals("负重登10楼")){
                        a.setApril(table.getTrainingProgram7());
                    }else if(a.getSubject().equals("400米救人疏散物资")){
                        a.setApril(table.getTrainingProgram8());
                    }else if(a.getSubject().equals("爬绳上四楼")){
                        a.setApril(table.getTrainingProgram9());
                    }else if(a.getSubject().equals("百米消防障碍")){
                        a.setApril(table.getTrainingProgram10());
                    }else if(a.getSubject().equals("60米肩梯")){
                        a.setApril(table.getTrainingProgram11());
                    }else if(a.getSubject().equals("搬运重物折返跑")){
                        a.setApril(table.getTrainingProgram12());
                    }else if(a.getSubject().equals("负重深蹲")){
                        a.setApril(table.getTrainingProgram13());
                    }else if(a.getSubject().equals("爬杆")){
                        a.setApril(table.getTrainingProgram14());
                    }
                }
            }else if(table.getEntryDate().equals("05")){
                for (PerformanceA a : performanceAS) {
                    if (a.getSubject().equals("100米跑")){
                        a.setMay(table.getTrainingProgram());
                    }else if(a.getSubject().equals("5000米跑")){
                        a.setMay(table.getTrainingProgram1());
                    }else if(a.getSubject().equals("游泳")){
                        a.setMay(table.getTrainingProgram2());
                    }else if(a.getSubject().equals("5x25折返跑")){
                        a.setMay(table.getTrainingProgram3());
                    }else if(a.getSubject().equals("单杠卷身上")){
                        a.setMay(table.getTrainingProgram4());
                    }else if(a.getSubject().equals("双杠臂屈伸")){
                        a.setMay(table.getTrainingProgram5());
                    }else if(a.getSubject().equals("百米负重跑")){
                        a.setMay(table.getTrainingProgram6());
                    }else if(a.getSubject().equals("负重登10楼")){
                        a.setMay(table.getTrainingProgram7());
                    }else if(a.getSubject().equals("400米救人疏散物资")){
                        a.setMay(table.getTrainingProgram8());
                    }else if(a.getSubject().equals("爬绳上四楼")){
                        a.setMay(table.getTrainingProgram9());
                    }else if(a.getSubject().equals("百米消防障碍")){
                        a.setMay(table.getTrainingProgram10());
                    }else if(a.getSubject().equals("60米肩梯")){
                        a.setMay(table.getTrainingProgram11());
                    }else if(a.getSubject().equals("搬运重物折返跑")){
                        a.setMay(table.getTrainingProgram12());
                    }else if(a.getSubject().equals("负重深蹲")){
                        a.setMay(table.getTrainingProgram13());
                    }else if(a.getSubject().equals("爬杆")){
                        a.setMay(table.getTrainingProgram14());
                    }
                }
            }else if(table.getEntryDate().equals("06")){
                for (PerformanceA a : performanceAS) {
                    if (a.getSubject().equals("100米跑")){
                        a.setJune(table.getTrainingProgram());
                    }else if(a.getSubject().equals("5000米跑")){
                        a.setJune(table.getTrainingProgram1());
                    }else if(a.getSubject().equals("游泳")){
                        a.setJune(table.getTrainingProgram2());
                    }else if(a.getSubject().equals("5x25折返跑")){
                        a.setJune(table.getTrainingProgram3());
                    }else if(a.getSubject().equals("单杠卷身上")){
                        a.setJune(table.getTrainingProgram4());
                    }else if(a.getSubject().equals("双杠臂屈伸")){
                        a.setJune(table.getTrainingProgram5());
                    }else if(a.getSubject().equals("百米负重跑")){
                        a.setJune(table.getTrainingProgram6());
                    }else if(a.getSubject().equals("负重登10楼")){
                        a.setJune(table.getTrainingProgram7());
                    }else if(a.getSubject().equals("400米救人疏散物资")){
                        a.setJune(table.getTrainingProgram8());
                    }else if(a.getSubject().equals("爬绳上四楼")){
                        a.setJune(table.getTrainingProgram9());
                    }else if(a.getSubject().equals("百米消防障碍")){
                        a.setJune(table.getTrainingProgram10());
                    }else if(a.getSubject().equals("60米肩梯")){
                        a.setJune(table.getTrainingProgram11());
                    }else if(a.getSubject().equals("搬运重物折返跑")){
                        a.setJune(table.getTrainingProgram12());
                    }else if(a.getSubject().equals("负重深蹲")){
                        a.setJune(table.getTrainingProgram13());
                    }else if(a.getSubject().equals("爬杆")){
                        a.setJune(table.getTrainingProgram14());
                    }
                }
            }else if(table.getEntryDate().equals("07")){
                for (PerformanceA a : performanceAS) {
                    if (a.getSubject().equals("100米跑")){
                        a.setJuly(table.getTrainingProgram());
                    }else if(a.getSubject().equals("5000米跑")){
                        a.setJuly(table.getTrainingProgram1());
                    }else if(a.getSubject().equals("游泳")){
                        a.setJuly(table.getTrainingProgram2());
                    }else if(a.getSubject().equals("5x25折返跑")){
                        a.setJuly(table.getTrainingProgram3());
                    }else if(a.getSubject().equals("单杠卷身上")){
                        a.setJuly(table.getTrainingProgram4());
                    }else if(a.getSubject().equals("双杠臂屈伸")){
                        a.setJuly(table.getTrainingProgram5());
                    }else if(a.getSubject().equals("百米负重跑")){
                        a.setJuly(table.getTrainingProgram6());
                    }else if(a.getSubject().equals("负重登10楼")){
                        a.setJuly(table.getTrainingProgram7());
                    }else if(a.getSubject().equals("400米救人疏散物资")){
                        a.setJuly(table.getTrainingProgram8());
                    }else if(a.getSubject().equals("爬绳上四楼")){
                        a.setJuly(table.getTrainingProgram9());
                    }else if(a.getSubject().equals("百米消防障碍")){
                        a.setJuly(table.getTrainingProgram10());
                    }else if(a.getSubject().equals("60米肩梯")){
                        a.setJuly(table.getTrainingProgram11());
                    }else if(a.getSubject().equals("搬运重物折返跑")){
                        a.setJuly(table.getTrainingProgram12());
                    }else if(a.getSubject().equals("负重深蹲")){
                        a.setJuly(table.getTrainingProgram13());
                    }else if(a.getSubject().equals("爬杆")){
                        a.setJuly(table.getTrainingProgram14());
                    }
                }
            }else if(table.getEntryDate().equals("08")){
                for (PerformanceA a : performanceAS) {
                    if (a.getSubject().equals("100米跑")){
                        a.setAugust(table.getTrainingProgram());
                    }else if(a.getSubject().equals("5000米跑")){
                        a.setAugust(table.getTrainingProgram1());
                    }else if(a.getSubject().equals("游泳")){
                        a.setAugust(table.getTrainingProgram2());
                    }else if(a.getSubject().equals("5x25折返跑")){
                        a.setAugust(table.getTrainingProgram3());
                    }else if(a.getSubject().equals("单杠卷身上")){
                        a.setAugust(table.getTrainingProgram4());
                    }else if(a.getSubject().equals("双杠臂屈伸")){
                        a.setAugust(table.getTrainingProgram5());
                    }else if(a.getSubject().equals("百米负重跑")){
                        a.setAugust(table.getTrainingProgram6());
                    }else if(a.getSubject().equals("负重登10楼")){
                        a.setAugust(table.getTrainingProgram7());
                    }else if(a.getSubject().equals("400米救人疏散物资")){
                        a.setAugust(table.getTrainingProgram8());
                    }else if(a.getSubject().equals("爬绳上四楼")){
                        a.setAugust(table.getTrainingProgram9());
                    }else if(a.getSubject().equals("百米消防障碍")){
                        a.setAugust(table.getTrainingProgram10());
                    }else if(a.getSubject().equals("60米肩梯")){
                        a.setAugust(table.getTrainingProgram11());
                    }else if(a.getSubject().equals("搬运重物折返跑")){
                        a.setAugust(table.getTrainingProgram12());
                    }else if(a.getSubject().equals("负重深蹲")){
                        a.setAugust(table.getTrainingProgram13());
                    }else if(a.getSubject().equals("爬杆")){
                        a.setAugust(table.getTrainingProgram14());
                    }
                }
            }else if(table.getEntryDate().equals("09")){
                for (PerformanceA a : performanceAS) {
                    if (a.getSubject().equals("100米跑")){
                        a.setSeptember(table.getTrainingProgram());
                    }else if(a.getSubject().equals("5000米跑")){
                        a.setSeptember(table.getTrainingProgram1());
                    }else if(a.getSubject().equals("游泳")){
                        a.setSeptember(table.getTrainingProgram2());
                    }else if(a.getSubject().equals("5x25折返跑")){
                        a.setSeptember(table.getTrainingProgram3());
                    }else if(a.getSubject().equals("单杠卷身上")){
                        a.setSeptember(table.getTrainingProgram4());
                    }else if(a.getSubject().equals("双杠臂屈伸")){
                        a.setSeptember(table.getTrainingProgram5());
                    }else if(a.getSubject().equals("百米负重跑")){
                        a.setSeptember(table.getTrainingProgram6());
                    }else if(a.getSubject().equals("负重登10楼")){
                        a.setSeptember(table.getTrainingProgram7());
                    }else if(a.getSubject().equals("400米救人疏散物资")){
                        a.setSeptember(table.getTrainingProgram8());
                    }else if(a.getSubject().equals("爬绳上四楼")){
                        a.setSeptember(table.getTrainingProgram9());
                    }else if(a.getSubject().equals("百米消防障碍")){
                        a.setSeptember(table.getTrainingProgram10());
                    }else if(a.getSubject().equals("60米肩梯")){
                        a.setSeptember(table.getTrainingProgram11());
                    }else if(a.getSubject().equals("搬运重物折返跑")){
                        a.setSeptember(table.getTrainingProgram12());
                    }else if(a.getSubject().equals("负重深蹲")){
                        a.setSeptember(table.getTrainingProgram13());
                    }else if(a.getSubject().equals("爬杆")){
                        a.setSeptember(table.getTrainingProgram14());
                    }
                }
            }else if(table.getEntryDate().equals("10")){
                for (PerformanceA a : performanceAS) {
                    if (a.getSubject().equals("100米跑")){
                        a.setOctober(table.getTrainingProgram());
                    }else if(a.getSubject().equals("5000米跑")){
                        a.setOctober(table.getTrainingProgram1());
                    }else if(a.getSubject().equals("游泳")){
                        a.setOctober(table.getTrainingProgram2());
                    }else if(a.getSubject().equals("5x25折返跑")){
                        a.setOctober(table.getTrainingProgram3());
                    }else if(a.getSubject().equals("单杠卷身上")){
                        a.setOctober(table.getTrainingProgram4());
                    }else if(a.getSubject().equals("双杠臂屈伸")){
                        a.setOctober(table.getTrainingProgram5());
                    }else if(a.getSubject().equals("百米负重跑")){
                        a.setOctober(table.getTrainingProgram6());
                    }else if(a.getSubject().equals("负重登10楼")){
                        a.setOctober(table.getTrainingProgram7());
                    }else if(a.getSubject().equals("400米救人疏散物资")){
                        a.setOctober(table.getTrainingProgram8());
                    }else if(a.getSubject().equals("爬绳上四楼")){
                        a.setOctober(table.getTrainingProgram9());
                    }else if(a.getSubject().equals("百米消防障碍")){
                        a.setOctober(table.getTrainingProgram10());
                    }else if(a.getSubject().equals("60米肩梯")){
                        a.setOctober(table.getTrainingProgram11());
                    }else if(a.getSubject().equals("搬运重物折返跑")){
                        a.setOctober(table.getTrainingProgram12());
                    }else if(a.getSubject().equals("负重深蹲")){
                        a.setOctober(table.getTrainingProgram13());
                    }else if(a.getSubject().equals("爬杆")){
                        a.setOctober(table.getTrainingProgram14());
                    }
                }
            }else if(table.getEntryDate().equals("11")){
                for (PerformanceA a : performanceAS) {
                    if (a.getSubject().equals("100米跑")){
                        a.setNovember(table.getTrainingProgram());
                    }else if(a.getSubject().equals("5000米跑")){
                        a.setNovember(table.getTrainingProgram1());
                    }else if(a.getSubject().equals("游泳")){
                        a.setNovember(table.getTrainingProgram2());
                    }else if(a.getSubject().equals("5x25折返跑")){
                        a.setNovember(table.getTrainingProgram3());
                    }else if(a.getSubject().equals("单杠卷身上")){
                        a.setNovember(table.getTrainingProgram4());
                    }else if(a.getSubject().equals("双杠臂屈伸")){
                        a.setNovember(table.getTrainingProgram5());
                    }else if(a.getSubject().equals("百米负重跑")){
                        a.setNovember(table.getTrainingProgram6());
                    }else if(a.getSubject().equals("负重登10楼")){
                        a.setNovember(table.getTrainingProgram7());
                    }else if(a.getSubject().equals("400米救人疏散物资")){
                        a.setNovember(table.getTrainingProgram8());
                    }else if(a.getSubject().equals("爬绳上四楼")){
                        a.setNovember(table.getTrainingProgram9());
                    }else if(a.getSubject().equals("百米消防障碍")){
                        a.setNovember(table.getTrainingProgram10());
                    }else if(a.getSubject().equals("60米肩梯")){
                        a.setNovember(table.getTrainingProgram11());
                    }else if(a.getSubject().equals("搬运重物折返跑")){
                        a.setNovember(table.getTrainingProgram12());
                    }else if(a.getSubject().equals("负重深蹲")){
                        a.setNovember(table.getTrainingProgram13());
                    }else if(a.getSubject().equals("爬杆")){
                        a.setNovember(table.getTrainingProgram14());
                    }
                }
            }else if(table.getEntryDate().equals("12")){
                for (PerformanceA a : performanceAS) {
                    if (a.getSubject().equals("100米跑")){
                        a.setDecember(table.getTrainingProgram());
                    }else if(a.getSubject().equals("5000米跑")){
                        a.setDecember(table.getTrainingProgram1());
                    }else if(a.getSubject().equals("游泳")){
                        a.setDecember(table.getTrainingProgram2());
                    }else if(a.getSubject().equals("5x25折返跑")){
                        a.setDecember(table.getTrainingProgram3());
                    }else if(a.getSubject().equals("单杠卷身上")){
                        a.setDecember(table.getTrainingProgram4());
                    }else if(a.getSubject().equals("双杠臂屈伸")){
                        a.setDecember(table.getTrainingProgram5());
                    }else if(a.getSubject().equals("百米负重跑")){
                        a.setDecember(table.getTrainingProgram6());
                    }else if(a.getSubject().equals("负重登10楼")){
                        a.setDecember(table.getTrainingProgram7());
                    }else if(a.getSubject().equals("400米救人疏散物资")){
                        a.setDecember(table.getTrainingProgram8());
                    }else if(a.getSubject().equals("爬绳上四楼")){
                        a.setDecember(table.getTrainingProgram9());
                    }else if(a.getSubject().equals("百米消防障碍")){
                        a.setDecember(table.getTrainingProgram10());
                    }else if(a.getSubject().equals("60米肩梯")){
                        a.setDecember(table.getTrainingProgram11());
                    }else if(a.getSubject().equals("搬运重物折返跑")){
                        a.setDecember(table.getTrainingProgram12());
                    }else if(a.getSubject().equals("负重深蹲")){
                        a.setDecember(table.getTrainingProgram13());
                    }else if(a.getSubject().equals("爬杆")){
                        a.setDecember(table.getTrainingProgram14());
                    }
                }
            }
        }
//        for (PerformanceA a : performanceAS) {
//            System.out.println(a);
//        }
        // 转换列表中的每个元素
        return getDataTable(performanceAS);
    }

    /**
     * 查询消防员信息列表
     */
    @GetMapping("/list")
    public TableDataInfo list(SysUser user) {
        try {
            startPage();
            List<SysUser> userList = userService.selectUserList(user);
            List<FirefighterInfo> result = new ArrayList<>();
            for (SysUser sysUser1 : userList) {
                FirefighterInfo firefighterInfo = new FirefighterInfo();
                firefighterInfo.setUserId(sysUser1.getUserId());
                List<FirefighterInfo> firefighterInfoList = firefighterInfoService.selectFirefighterInfoList(firefighterInfo);
                // 将当前用户的记录添加到结果列表中
                result.addAll(firefighterInfoList);
            }
            log.info("查询用户列表成功, 结果数量: {}", result.size());
            return getDataTable(result);
        } catch (Exception e) {
            log.error("查询用户列表失败", e);
            throw new ServiceException("获取用户信息异常");
        }
    }


    /**
     * 获取消防员信息详细信息档案
     */
    @PostMapping(value = "/getInfo")
    public AjaxResult getInfo(@RequestBody FirefighterInfo  firefighterInfo1)
    {

        Long id = firefighterInfo1.getId();
        //登录人userID
        Long userIdLogin = firefighterInfo1.getUserIdLogin();
        Roleo role1 = new Roleo();
        role1.setUserId(userIdLogin);
        Roleo  role = firefighterFireService.selectRoleName(role1);
        String roleName = role.getRoleName();
        FirefighterInfo firefighterInfo = firefighterInfoService.selectFirefighterInfoByUserId(userIdLogin);
        System.out.println("当前用户为"+roleName+"=======当前人id"+userIdLogin+"=====访问id"+firefighterInfo1.getUserId());
        if (roleName.equals("超级管理员")||roleName.equals("管理员")){
            FirefighterDetailsDTO infouser = getInfouser(id);
            return AjaxResult.success(infouser);
        } else if (roleName.equals("普通角色")&&firefighterInfo.getId().equals(id)){
            FirefighterDetailsDTO infouser = getInfouser(id);
            return AjaxResult.success(infouser);
        }
         return AjaxResult.error("普通用户只能查看自己");
    }
   public FirefighterDetailsDTO getInfouser(Long id){
       FirefighterInfo firefighterInfo = firefighterInfoService.selectFirefighterInfoById(id); //基本信息
       FirefighterRecord firefighterRecord = new FirefighterRecord();
       firefighterRecord.setFirefighterId(firefighterInfo.getUserId());
       List<FirefighterRecord> recordList = firefighterRecordService.selectFirefighterRecordList(firefighterRecord);//个人履历
       FirefighterQualification firefighterQualification = new FirefighterQualification();
       firefighterQualification.setFirefightId(firefighterInfo.getUserId());
       List<FirefighterQualification> qualificationList = firefighterQualificationService.selectFirefighterQualificationList(firefighterQualification);//查询专业资质列表
       FirefighterAward firefighterAward = new FirefighterAward();
       firefighterAward.setFirefighterId(firefighterInfo.getUserId());
       List<FirefighterAward> awardList = firefighterAwardService.selectFirefighterAwardList(firefighterAward);
       FirefighterPunishment firefighterPunishment = new FirefighterPunishment();
       firefighterPunishment.setFirefighterId(firefighterInfo.getUserId());
       List<FirefighterPunishment> punishmentList = firefighterPunishmentService.selectFirefighterPunishmentList(firefighterPunishment);//查询处分情况列表
       FirefighterTrain firefighterTrain = new FirefighterTrain();
       firefighterTrain.setFirefighterId(firefighterInfo.getUserId());
       List<FirefighterTrain> trainList = firefighterTrainService.selectFirefighterTrainList(firefighterTrain);//查询培训经历列表
       FirefighterFireTask firefighterFireTask = new FirefighterFireTask();
       firefighterFireTask.setFirefighterId(firefighterInfo.getUserId());
       List<FirefighterFireTask> taskList = firefighterFireTaskService.selectFirefighterFireTaskList(firefighterFireTask);//查询重大火灾任务列表
       FirefighterEmergency firefighterEmergency = new FirefighterEmergency();
       firefighterEmergency.setFirefighterId(firefighterInfo.getUserId());
       List<FirefighterEmergency> emergencyList = firefighterEmergencyService.selectFirefighterEmergencyList(firefighterEmergency);//查询重大应急救援任务列表
       FirefighterTournament firefighterTournament = new FirefighterTournament();
       firefighterTournament.setFirefighterId(firefighterInfo.getUserId());
       List<FirefighterTournament> tournamentList = firefighterTournamentService.selectFirefighterTournamentList(firefighterTournament);//查询比武竞赛情况列表
       FirefighterSecurity firefighterSecurity = new FirefighterSecurity();
       firefighterSecurity.setFirefighterId(firefighterInfo.getUserId());
       List<FirefighterSecurity> securityList = firefighterSecurityService.selectFirefighterSecurityList(firefighterSecurity);//查询执行重大安保任务列表
       FirefighterDrill firefighterDrill = new FirefighterDrill();
       firefighterDrill.setFirefighterId(firefighterInfo.getUserId());
       List<FirefighterDrill> drillList = firefighterDrillService.selectFirefighterDrillList(firefighterDrill);//查询重大演习演练列表
       FirefighterDisease firefighterDisease = new FirefighterDisease();
       firefighterDisease.setFirefighterId(firefighterInfo.getUserId());
       List<FirefighterDisease> diseaseList = firefighterDiseaseService.selectFirefighterDiseaseList(firefighterDisease);
       List<GraduationSchool> graduationSchools = iGraduationSchoolService.selectGraduationSchoolByfId(firefighterInfo.getUserId().toString());
       GraduationSchool latestSchool = null;
       long maxTimestamp = Long.MIN_VALUE;  // 设置最小值，初始假定没有比这个更大的时间戳
       for (GraduationSchool school : graduationSchools) {
           String graduationDate = school.getGraduationDate();
           DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
           LocalDate localDate = LocalDate.parse(graduationDate, formatter);
           Date date = Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
           long timestamp = date.getTime();  // 获取该学校毕业日期的时间戳

           // 如果当前时间戳大于之前记录的最大时间戳，更新最大时间戳和对应的 GraduationSchool
           if (timestamp > maxTimestamp) {
               maxTimestamp = timestamp;
               latestSchool = school;
           }
       }
       if (latestSchool!=null){
           firefighterInfo.setGraduationSchool(latestSchool.getGraduationSchoolName());
           firefighterInfo.setMajor(latestSchool.getMajor());
       }
       FirefighterDetailsDTO detailsDTO = new FirefighterDetailsDTO();
       detailsDTO.setFirefighterInfo(firefighterInfo);
       detailsDTO.setRecordList(recordList);
       detailsDTO.setAwardList(awardList);
       detailsDTO.setPunishmentList(punishmentList);
       detailsDTO.setTrainList(trainList);
       detailsDTO.setQualificationList(qualificationList);
       detailsDTO.setTaskList(taskList);
       detailsDTO.setEmergencyList(emergencyList);
       detailsDTO.setTournamentList(tournamentList);
       detailsDTO.setSecurityList(securityList);
       detailsDTO.setDrillList(drillList);
       detailsDTO.setDiseaseList(diseaseList);
       detailsDTO.setGraduationSchools(graduationSchools);
       return detailsDTO;
   }

    //灭火救援岗位技能科目統計表
    @GetMapping("/trainingTable/Count")
    public Map<String, Object> trainingTableCount(@RequestParam  Long userId, @RequestParam String trainingType) {
        // 清理 trainingType，去除所有空白字符
        String cleanedTrainingType = trainingType.replaceAll("\\s+", "");
        System.out.println("Cleaned trainingType: " + cleanedTrainingType);

        // 创建查询对象
        FirefighterTrainingTable firefighterTrainingTable = new FirefighterTrainingTable();
        firefighterTrainingTable.setUserId(userId);
        // 获取数据列表
        List<FirefighterTrainingTable> list = firefighterTrainingTableService.selectFirefighterTrainingTableList(firefighterTrainingTable);

        // 过滤和统计
        List<String> categories = new ArrayList<>();
        List<Integer> values = new ArrayList<>();
        for (FirefighterTrainingTable table : list) {
            if (cleanedTrainingType.equalsIgnoreCase("单杠卷身上")) {
                categories.add(table.getTrainingProgram());
            }else if (cleanedTrainingType.equalsIgnoreCase("双杠臂屈伸")) {
                categories.add(table.getTrainingProgram1());
            }else if (cleanedTrainingType.equalsIgnoreCase("负重深蹲")) {
                categories.add(table.getTrainingProgram2());
            }else if (cleanedTrainingType.equalsIgnoreCase("负重深蹲")){
                categories.add(table.getTrainingProgram3());
            }else if (cleanedTrainingType.equalsIgnoreCase("爬杆")){
                categories.add(table.getTrainingProgram4());
            }else if (cleanedTrainingType.equalsIgnoreCase("100米跑")){
                categories.add(table.getTrainingProgram5());
            }else if (cleanedTrainingType.equalsIgnoreCase("5000米跑")){
                categories.add(table.getTrainingProgram4());
            }else if (cleanedTrainingType.equalsIgnoreCase("5×25米折返跑")){
                categories.add(table.getTrainingProgram4());
            }else if (cleanedTrainingType.equalsIgnoreCase("游泳")){
                categories.add(table.getTrainingProgram3());
            }else if (cleanedTrainingType.equalsIgnoreCase("百米负重跑")){
                categories.add(table.getTrainingProgram4());
            }else if (cleanedTrainingType.equalsIgnoreCase("负重登10楼")){
                categories.add(table.getTrainingProgram5());
            }else if (cleanedTrainingType.equalsIgnoreCase("400米救人疏散物资")){
                categories.add(table.getTrainingProgram4());
            }else if (cleanedTrainingType.equalsIgnoreCase("爬绳上四楼")){
                categories.add(table.getTrainingProgram4());
            }else if (cleanedTrainingType.equalsIgnoreCase("百米消防障碍")){
                categories.add(table.getTrainingProgram4());
            }else if (cleanedTrainingType.equalsIgnoreCase("60米肩梯")){
                categories.add(table.getTrainingProgram4());
            }else if (cleanedTrainingType.equalsIgnoreCase("搬运重物折返跑")){
                categories.add(table.getTrainingProgram4());
            }
        }
        // 构建返回的数据
        Map<String, Object> result = new HashMap<>();
        result.put("xAxis", categories);
        result.put("yAxis", values);
        return result;
    }

//    @GetMapping("/trainingTable/List")
//    public AjaxResult trainingTableList(@RequestParam Long userId) {
//        startPage();
//        FirefighterTrainingTable firefighterTrainingTable = new FirefighterTrainingTable();
//        firefighterTrainingTable.setUserId(userId);
//        List<FirefighterTrainingTable> list = firefighterTrainingTableService.selectFirefighterTrainingTableList(firefighterTrainingTable);
//
//        // 创建 14 个列表来存储每个训练项目的分数
//        List<Integer> trainingProgramScores = new ArrayList<>();
//        List<Integer> trainingProgram1Scores = new ArrayList<>();
//        List<Integer> trainingProgram2Scores = new ArrayList<>();
//        List<Integer> trainingProgram3Scores = new ArrayList<>();
//        List<Integer> trainingProgram4Scores = new ArrayList<>();
//        List<Integer> trainingProgram5Scores = new ArrayList<>();
//        List<Integer> trainingProgram6Scores = new ArrayList<>();
//        List<Integer> trainingProgram7Scores = new ArrayList<>();
//        List<Integer> trainingProgram8Scores = new ArrayList<>();
//        List<Integer> trainingProgram9Scores = new ArrayList<>();
//        List<Integer> trainingProgram10Scores = new ArrayList<>();
//        List<Integer> trainingProgram11Scores = new ArrayList<>();
//        List<Integer> trainingProgram12Scores = new ArrayList<>();
//        List<Integer> trainingProgram13Scores = new ArrayList<>();
//        List<Integer> trainingProgram14Scores = new ArrayList<>();
//
//        // 遍历列表并填充每个训练项目的分数
//        for (FirefighterTrainingTable table : list) {
//            try {
//                trainingProgramScores.add(Integer.parseInt(table.getTrainingProgram()));
//                trainingProgram1Scores.add(Integer.parseInt(table.getTrainingProgram1()));
//                trainingProgram2Scores.add(Integer.parseInt(table.getTrainingProgram2()));
//                trainingProgram3Scores.add(Integer.parseInt(table.getTrainingProgram3()));
//                trainingProgram4Scores.add(Integer.parseInt(table.getTrainingProgram4()));
//                trainingProgram5Scores.add(Integer.parseInt(table.getTrainingProgram5()));
//                trainingProgram6Scores.add(Integer.parseInt(table.getTrainingProgram6()));
//                trainingProgram7Scores.add(Integer.parseInt(table.getTrainingProgram7()));
//                trainingProgram8Scores.add(Integer.parseInt(table.getTrainingProgram8()));
//                trainingProgram9Scores.add(Integer.parseInt(table.getTrainingProgram9()));
//                trainingProgram10Scores.add(Integer.parseInt(table.getTrainingProgram10()));
//                trainingProgram11Scores.add(Integer.parseInt(table.getTrainingProgram11()));
//                trainingProgram12Scores.add(Integer.parseInt(table.getTrainingProgram12()));
//                trainingProgram13Scores.add(Integer.parseInt(table.getTrainingProgram13()));
//                trainingProgram14Scores.add(Integer.parseInt(table.getTrainingProgram14()));
//            } catch (NumberFormatException e) {
//                // 处理转换异常，例如记录日志或返回错误信息
//                return new AjaxResult(500, "数据格式错误", null);
//            }
//        }
//
//        // 构建返回的数据
//        Map<String, Object> result = new HashMap<>();
//        result.put("total", list.size());
//        result.put("trainingProgramScores", trainingProgramScores);
//        result.put("trainingProgram1Scores", trainingProgram1Scores);
//        result.put("trainingProgram2Scores", trainingProgram2Scores);
//        result.put("trainingProgram3Scores", trainingProgram3Scores);
//        result.put("trainingProgram4Scores", trainingProgram4Scores);
//        result.put("trainingProgram5Scores", trainingProgram5Scores);
//        result.put("trainingProgram6Scores", trainingProgram6Scores);
//        result.put("trainingProgram7Scores", trainingProgram7Scores);
//        result.put("trainingProgram8Scores", trainingProgram8Scores);
//        result.put("trainingProgram9Scores", trainingProgram9Scores);
//        result.put("trainingProgram10Scores", trainingProgram10Scores);
//        result.put("trainingProgram11Scores", trainingProgram11Scores);
//        result.put("trainingProgram12Scores", trainingProgram12Scores);
//        result.put("trainingProgram13Scores", trainingProgram13Scores);
//        result.put("trainingProgram14Scores", trainingProgram14Scores);
//
//        return new AjaxResult(200, "查询成功", result);
//    }


    //体能科目训练統計表
    @GetMapping("/firefighter/Count")
    public Map<String, Object> firefighterCount(@RequestParam(defaultValue = "0") Long userId, @RequestParam String trainingType) {
        // 清理 trainingType，去除所有空白字符
        String cleanedTrainingType = trainingType.replaceAll("\\s+", "");
        System.out.println("Cleaned trainingType: " + cleanedTrainingType);

        // 创建查询对象
        FirefighterFireTable firefighterFireTable = new FirefighterFireTable();
        firefighterFireTable.setUserId(userId);
        // 获取数据列表
        List<FirefighterFireTable> list = firefighterFireTableService.selectFirefighterFireTableList(firefighterFireTable);

        // 过滤和统计
        List<String> categories = new ArrayList<>();
        List<Integer> values = new ArrayList<>();
        for (FirefighterFireTable table : list) {
            try {
                if ("单一人三盘水带连接".equalsIgnoreCase(cleanedTrainingType)) {
                    categories.add(table.getFireProgram());
                    values.add(Integer.parseInt(table.getFireProgram()));
                } else if ("沿拉梯铺设水带".equalsIgnoreCase(cleanedTrainingType)) {
                    categories.add(table.getFireProgram1());
                    values.add(Integer.parseInt(table.getFireProgram1()));
                } else if ("垂直铺设水带".equalsIgnoreCase(cleanedTrainingType)) {
                    categories.add(table.getFireProgram2());
                    values.add(Integer.parseInt(table.getFireProgram2()));
                } else if ("狭小空间铺设水带".equalsIgnoreCase(cleanedTrainingType)) {
                    categories.add(table.getFireProgram3());
                    values.add(Integer.parseInt(table.getFireProgram3()));
                } else if ("吸水管连接".equalsIgnoreCase(cleanedTrainingType)) {
                    categories.add(table.getFireProgram4());
                    values.add(Integer.parseInt(table.getFireProgram4()));
                } else if ("射水技术".equalsIgnoreCase(cleanedTrainingType)) {
                    categories.add(table.getFireProgram5());
                    values.add(Integer.parseInt(table.getFireProgram5()));
                } else if ("攀登挂钩梯上四楼".equalsIgnoreCase(cleanedTrainingType)) {
                    categories.add(table.getFireProgram6());
                    values.add(Integer.parseInt(table.getFireProgram6()));
                } else if ("攀登单杠梯".equalsIgnoreCase(cleanedTrainingType)) {
                    categories.add(table.getFireProgram7());
                    values.add(Integer.parseInt(table.getFireProgram7()));
                } else if ("两人五盘水带连接".equalsIgnoreCase(cleanedTrainingType)) {
                    categories.add(table.getFireProgram8());
                    values.add(Integer.parseInt(table.getFireProgram8()));
                } else if ("干线水带更换".equalsIgnoreCase(cleanedTrainingType)) {
                    categories.add(table.getFireProgram9());
                    values.add(Integer.parseInt(table.getFireProgram9()));
                } else if ("楼层吊升水带".equalsIgnoreCase(cleanedTrainingType)) {
                    categories.add(table.getFireProgram10());
                    values.add(Integer.parseInt(table.getFireProgram10()));
                } else if ("水带登高伸长".equalsIgnoreCase(cleanedTrainingType)) {
                    categories.add(table.getFireProgram11());
                    values.add(Integer.parseInt(table.getFireProgram11()));
                } else if ("垂直更换水带".equalsIgnoreCase(cleanedTrainingType)) {
                    categories.add(table.getFireProgram12());
                    values.add(Integer.parseInt(table.getFireProgram12()));
                } else if ("水枪前延长水带".equalsIgnoreCase(cleanedTrainingType)) {
                    categories.add(table.getFireProgram13());
                    values.add(Integer.parseInt(table.getFireProgram13()));
                } else if ("分水器前延长水带".equalsIgnoreCase(cleanedTrainingType)) {
                    categories.add(table.getFireProgram14());
                    values.add(Integer.parseInt(table.getFireProgram14()));
                }
            } catch (NumberFormatException e) {
                // 处理转换异常，例如记录日志或返回错误信息
                return Collections.singletonMap("error", "数据格式错误");
            }
        }

        // 构建返回的数据
        Map<String, Object> option = new HashMap<>();

        // 设置全局动画配置
        Map<String, Object> animationConfig = new HashMap<>();
        animationConfig.put("animation", true);
        animationConfig.put("animationDuration", 1000);
        animationConfig.put("animationDurationUpdate", 500);
        animationConfig.put("animationEasing", "cubicInOut");
        animationConfig.put("animationEasingUpdate", "cubicInOut");
        animationConfig.put("animationThreshold", 2000);
        animationConfig.put("progressiveThreshold", 3000);
        animationConfig.put("progressive", 400);
        animationConfig.put("hoverLayerThreshold", 3000);
        animationConfig.put("useUTC", false);
        option.put("animation", animationConfig);

        // 设置x轴
        Map<String, Object> xAxis = new HashMap<>();
        xAxis.put("type", "category");
        xAxis.put("data", categories);
        option.put("xAxis", Collections.singletonList(xAxis));

        // 设置y轴
        Map<String, Object> yAxis = new HashMap<>();
        yAxis.put("type", "value");
        option.put("yAxis", Collections.singletonList(yAxis));

        // 设置系列
        Map<String, Object> series = new HashMap<>();
        series.put("name", "训练成绩");
        series.put("type", "bar");
        series.put("data", values);
        option.put("series", Collections.singletonList(series));

        return option;
    }

    /**
     * 导出消防员信息列表
     */
    @PostMapping("/export")
    public void export(HttpServletResponse response, @RequestBody ExportFilter filter) {
        // 使用filter对象查询数据
        List<FirefighterInfo> list = firefighterInfoService.queryByFilter(filter);

        // 导出Excel
        ExcelUtil<FirefighterInfo> util = new ExcelUtil<>(FirefighterInfo.class);
        util.exportExcel(response, list, "消防员信息数据");
    }

}
